Skip to content
Permalink
Browse files

Add Dockerfile for `nginx`

  • Loading branch information...
tnation14 committed Feb 23, 2018
1 parent 6fc29f9 commit 20b827b46a6dabb03b2765b71f71631f2dab7952
Showing with 21 additions and 6 deletions.
  1. +3 −1 .dockerignore
  2. +7 −5 docker-compose.yml
  3. +11 −0 nginx/Dockerfile
@@ -1 +1,3 @@
.git/
*
!nginx/
!django/
@@ -25,15 +25,17 @@ services:
nginx:
env_file:
- .env
image: nginx:1.12
build:
context: .
dockerfile: nginx/Dockerfile
args:
WEB_APP_PORT: "${WEB_APP_PORT}"
ports:
- "${WEB_APP_PORT}:${WEB_APP_PORT}"
volumes:
- ./nginx/:/etc/nginx/conf.d
- ./django/publicmapping/static:/opt/static/
- sld:/opt/sld/
- ./django/publicmapping/static/:/opt/static/
- ./sld:/opt/sld/
- reports:/opt/reports
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
depends_on:
- django

@@ -0,0 +1,11 @@
FROM nginx:1.12

ARG WEB_APP_PORT

COPY nginx/default.template /etc/nginx/conf.d/default.template
COPY django/publicmapping/static/ /opt/static/

RUN envsubst < /etc/nginx/conf.d/default.template \
> /etc/nginx/conf.d/default.conf \
&& rm /etc/nginx/conf.d/default.template \
&& chown -R nginx:nginx /opt/static

0 comments on commit 20b827b

Please sign in to comment.
You can’t perform that action at this time.