FROM python:3-alpine #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 RUN pip install uwsgi WORKDIR /usr/share/app # 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 ENTRYPOINT ["./entrypoint.sh"]