-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (28 loc) · 1.33 KB
/
Dockerfile
File metadata and controls
30 lines (28 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# mesudip/python-nginx:alpine is merge of official python and nginx images.
FROM mesudip/python-nginx
RUN pip install --upgrade pip
HEALTHCHECK --interval=10s --timeout=2s --start-period=10s --retries=3 CMD pgrep nginx && pgrep python3 >> /dev/null || exit 1
CMD ["sh","-e" ,"/docker-entrypoint.sh"]
COPY ./requirements.txt /requirements.txt
RUN apk --no-cache add openssl && \
apk add --no-cache --virtual .build-deps \
gcc libc-dev openssl-dev linux-headers libffi-dev && \
pip install --no-cache-dir -r /requirements.txt && \
rm -f /requirements.txt && apk del .build-deps && \
ln -s /app/getssl /bin/getssl && ln -s /app/verify /bin/verify && \
mv /docker-entrypoint.sh /nginx-entrypoint.sh && \
ln -s /app/docker-entrypoint.sh /docker-entrypoint.sh
RUN rm -rf /var/log/nginx/* && chown nginx:nginx /var/log/nginx && truncate -s 0 /etc/nginx/conf.d/default.conf
COPY ./vhosts_template/nginx.conf /etc/nginx/nginx.conf
ARG LETSENCRYPT_API="https://acme-v02.api.letsencrypt.org/directory"
ENV LETSENCRYPT_API=${LETSENCRYPT_API} \
CHALLENGE_DIR=/etc/nginx/challenges/ \
DHPARAM_SIZE=2048 \
CLIENT_MAX_BODY_SIZE=1m \
NGINX_WORKER_PROCESSES=auto \
NGINX_WORKER_CONNECTIONS=65535 \
SSL_DIR=/etc/nginx/ssl \
DEFAULT_HOST=true \
VHOSTS_TEMPLATE_DIR=/app/vhosts_template
WORKDIR /app
COPY . /app/