2021-02-04 18:11:00 +00:00
|
|
|
|
FROM python:3-alpine
|
2021-02-05 16:11:47 +00:00
|
|
|
|
#TODO as an educational env, we sould use debian or centos. more like debian ? A dockerfile each ?
|
|
|
|
|
|
|
|
|
|
RUN apk update && apk add gcc linux-headers build-base nginx openssh
|
2021-02-04 18:11:00 +00:00
|
|
|
|
RUN pip install uwsgi
|
2021-02-05 16:11:47 +00:00
|
|
|
|
|
2021-02-04 18:11:00 +00:00
|
|
|
|
WORKDIR /usr/share/app
|
2021-02-05 16:11:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Python app
|
|
|
|
|
COPY python_app/* ./
|
|
|
|
|
|
|
|
|
|
ENV UID=33
|
|
|
|
|
ENV MOUNT=/
|
|
|
|
|
|
|
|
|
|
RUN MKDIR /tmp/uwsgi
|
|
|
|
|
CMD ["uwsgi", "--chown-socket", "$UID", "-s", "/tmp/uwsgi/uwsgi.sock", "--manage-script-name", "--mount", "$MOUNT=main:prod_app", "--http-timeout", "10", "--master", "--hook-master-start", "unix_signal:15gracefully_kill_them_all", "--need-app", "--die-on-term", "--show-config", "--log-master", "--strict", "--vacuum", "--single-interpreter"]
|
|
|
|
|
|
|
|
|
|
# SSH server
|
|
|
|
|
|
|
|
|
|
# Nginx server
|
|
|
|
|
COPY ./nginx.conf /etc/nginx/nginx.conf
|
|
|
|
|
|
|
|
|
|
# Entrypoint
|
|
|
|
|
COPY ./entrypoint.sh ./entrypoint.sh
|
2021-02-04 18:11:00 +00:00
|
|
|
|
ENTRYPOINT ["./entrypoint.sh"]
|