cours-snt/test-python-ssh/Dockerfile
2021-02-05 17:11:47 +01:00

27 lines
815 B
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"]