Coder Social home page Coder Social logo

docker-python3-flask-uwsgi-mssql's Introduction

docker-python3-flask-uwsgi-mssql

Python3 environment ready for deploy flask applications with uwsgi and Microsoft SQL Server client

This is Docker image I use for deploy python flask applications that use Microsoft SQL Server as database. It uses pyodbc and SQLAlchemy for database related stuff.

Based on Debian 12.

Python has already installed following packages and its dependancies:

alembic==1.13.1
aniso8601==9.0.1
astroid==3.1.0
blinker==1.7.0
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
dill==0.3.8
Flask==3.0.2
Flask-RESTful==0.3.10
greenlet==3.0.3
idna==3.6
isort==5.13.2
itsdangerous==2.1.2
Jinja2==3.1.3
lxml==5.1.0
Mako==1.3.2
MarkupSafe==2.1.5
mccabe==0.7.0
platformdirs==4.2.0
pylint==3.1.0
pytz==2024.1
requests==2.31.0
six==1.16.0
SQLAlchemy==2.0.28
tomli==2.0.1
tomlkit==0.12.4
typing_extensions==4.10.0
urllib3==2.2.1
Werkzeug==3.0.1

All you need to add is your application files, and simple script for start.

Image starts uwsgi server, it can be configured via environment variables. You can use it with nginx or standalone.

Following setup

APP_IP=0.0.0.0
APP_PORT=5000
APP_PROTOCOL=http
APP_PATH=/
APP_MODULE=flask
PROCESSES=1
THREADS=1

produces this command to start uwsgi server.

uwsgi --socket 0.0.0.0:5000 --protocol http --mount /=flask:app --manage-script-name --processes 1 --threads 1

Here is Dockerfile example, it cannot be simplier:

FROM emes/python3

WORKDIR /app

COPY . .

and this is command for building your container:

docker run -e APP_MODULE=my_module emes/my-module

nginx configuration:

location /yourapp
{
  uwsgi_pass your_app_ip:5000;
  include uwsgi_params;
}

docker-python3-flask-uwsgi-mssql's People

Contributors

emes30 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.