1
0
Fork 0
mirror of https://github.com/docker/awesome-compose.git synced 2025-04-26 10:43:35 +02:00

init nginx-wsgi-flask

Signed-off-by: Grant Birkinbine <grant.birkinbine@gmail.com>
This commit is contained in:
Grant Birkinbine 2021-03-20 22:10:46 -07:00
parent a92c067f75
commit 7cf1cf4789
No known key found for this signature in database
GPG key ID: B0409256808CFF4A
10 changed files with 312 additions and 0 deletions

View file

@ -0,0 +1,32 @@
FROM nginx:1.19.3-alpine
# Add bash for boot cmd
RUN apk add bash
# Add nginx.conf to container
COPY --chown=nginx:nginx nginx.conf /etc/nginx/nginx.conf
COPY --chown=nginx:nginx start.sh /app/start.sh
# set workdir
WORKDIR /app
# permissions and nginx user for tightened security
RUN chown -R nginx:nginx /app && chmod -R 755 /app && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chmod -R 755 /var/log/nginx; \
chown -R nginx:nginx /etc/nginx/conf.d
RUN touch /var/run/nginx.pid && chown -R nginx:nginx /var/run/nginx.pid
# # Uncomment to keep the nginx logs inside the container - Leave commented for logging to stdout and stderr
# RUN mkdir -p /var/log/nginx
# RUN unlink /var/log/nginx/access.log \
# && unlink /var/log/nginx/error.log \
# && touch /var/log/nginx/access.log \
# && touch /var/log/nginx/error.log \
# && chown nginx /var/log/nginx/*log \
# && chmod 644 /var/log/nginx/*log
USER nginx
CMD ["nginx", "-g", "'daemon off;'"]