Last active
July 29, 2021 13:00
-
-
Save milnomada/a69280c8e5b06f744534678cf9e37962 to your computer and use it in GitHub Desktop.
Python Socket.io Server Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.6.5-slim AS sobase | |
RUN apt-get clean && apt-get -y update | |
RUN apt-get -y install python3-dev build-essential | |
RUN apt-get -y install libssl-dev | |
RUN mkdir /code | |
COPY requirements.txt /code | |
RUN CFLAGS="-I/usr/local/opt/openssl/include" \ | |
LDFLAGS="-L/usr/local/opt/openssl/lib" \ | |
UWSGI_PROFILE_OVERRIDE=ssl=true \ | |
pip3 install uwsgi -I --no-cache-dir | |
RUN pip install -r /code/requirements.txt --src /usr/local/src | |
COPY ./app /code/app | |
COPY ./libs /code/libs | |
WORKDIR /code | |
FROM sobase AS socket | |
CMD uwsgi \ | |
--http11-socket 0.0.0.0:3333 -w app.sosrv:app \ | |
--enable-threads \ | |
--threads 4 \ | |
--log-x-forwarded-for \ | |
--logformat '%(addr) - %(user) [%(ltime)] "%(method) %(uri) %(proto)" %(status) %(size) "%(referer)" "%(uagent)"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment