Created
February 24, 2020 10:43
-
-
Save snnwolf/fe4e9846d5c4122c83e0e7aecfba65da to your computer and use it in GitHub Desktop.
Docker файл для прода, напр, flask
This file contains hidden or 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.3-alpine3.6 | |
COPY requirements.txt / | |
RUN apk --update add --virtual .base build-base && \ | |
apk add --no-cache postgresql-dev && \ | |
pip install -r requirements.txt && \ | |
rm requirements.txt && \ | |
apk del .base && \ | |
adduser -D -S -u 1000 -G users -h /home/app app && \ | |
rm -rf /tmp/* /var/tmp/* /usr/share/man /tmp/* /var/tmp/* \ | |
/var/cache/apk/* /var/log/* ~/.cache | |
COPY . /home/app/ | |
RUN chmod +x /home/app/app.py && \ | |
chown -R app:users /home/app | |
USER app | |
WORKDIR /home/app | |
CMD python -m flask run --host=0.0.0.0 --with-threads |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment