Loading .dockerignore +1 −0 Original line number Diff line number Diff line * !nginx/**/* !scripts/**/* Dockerfile +6 −0 Original line number Diff line number Diff line Loading @@ -3,3 +3,9 @@ FROM nginx:alpine LABEL maintainer="info@redmic.es" COPY nginx /etc/nginx COPY scripts/entrypoint.sh /entrypoint.sh RUN apk add --no-cache openssl CMD ["sh", "-c", "/entrypoint.sh"] deploy/.env 0 → 100644 +1 −0 Original line number Diff line number Diff line PERSISTENT_PATH=/var/nginx/persistent deploy/docker-compose.tmpl.yml +8 −7 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ version: '3.5' services: nginx-proxy: image: ${IMAGE_NAME}:${IMAGE_TAG:-latest} environment: - PERSISTENT_PATH networks: - traefik-net ports: Loading @@ -13,6 +15,7 @@ services: published: 443 mode: host volumes: - persistent-vol:${PERSISTENT_PATH} - cache-vol:/var/nginx/cache - acme-vol:/var/www/html secrets: Loading @@ -22,8 +25,6 @@ services: target: /etc/nginx/certs/fullchain.pem - source: cert-privkey target: /etc/nginx/certs/privkey.pem - source: cert-dhparam target: /etc/nginx/certs/dhparam.pem healthcheck: test: wget --spider -S -t 3 http://${PUBLIC_HOSTNAME:-localhost} interval: 30s Loading @@ -38,7 +39,7 @@ services: window: 2m resources: limits: cpus: '4' cpus: '2' memory: 128M reservations: memory: 103M Loading @@ -49,7 +50,10 @@ networks: volumes: cache-vol: name: cache-vol name: nginx-cache-vol persistent-vol: name: nginx-persistent-vol acme-vol: name: acme-vol Loading @@ -63,6 +67,3 @@ secrets: cert-privkey: external: true cert-dhparam: external: true scripts/entrypoint.sh 0 → 100755 +16 −0 Original line number Diff line number Diff line #!/bin/sh if [ -z "${PERSISTENT_PATH}" ] then echo "PERSISTENT_PATH variable should be defined!" exit 1 fi dhparamFile="${PERSISTENT_PATH}/dhparam.pem" if [ ! -e "${dhparamFile}" ] then echo "DHParam not found, generating.." openssl dhparam -out "${dhparamFile}" 4096 fi nginx -g 'daemon off;' Loading
Dockerfile +6 −0 Original line number Diff line number Diff line Loading @@ -3,3 +3,9 @@ FROM nginx:alpine LABEL maintainer="info@redmic.es" COPY nginx /etc/nginx COPY scripts/entrypoint.sh /entrypoint.sh RUN apk add --no-cache openssl CMD ["sh", "-c", "/entrypoint.sh"]
deploy/.env 0 → 100644 +1 −0 Original line number Diff line number Diff line PERSISTENT_PATH=/var/nginx/persistent
deploy/docker-compose.tmpl.yml +8 −7 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ version: '3.5' services: nginx-proxy: image: ${IMAGE_NAME}:${IMAGE_TAG:-latest} environment: - PERSISTENT_PATH networks: - traefik-net ports: Loading @@ -13,6 +15,7 @@ services: published: 443 mode: host volumes: - persistent-vol:${PERSISTENT_PATH} - cache-vol:/var/nginx/cache - acme-vol:/var/www/html secrets: Loading @@ -22,8 +25,6 @@ services: target: /etc/nginx/certs/fullchain.pem - source: cert-privkey target: /etc/nginx/certs/privkey.pem - source: cert-dhparam target: /etc/nginx/certs/dhparam.pem healthcheck: test: wget --spider -S -t 3 http://${PUBLIC_HOSTNAME:-localhost} interval: 30s Loading @@ -38,7 +39,7 @@ services: window: 2m resources: limits: cpus: '4' cpus: '2' memory: 128M reservations: memory: 103M Loading @@ -49,7 +50,10 @@ networks: volumes: cache-vol: name: cache-vol name: nginx-cache-vol persistent-vol: name: nginx-persistent-vol acme-vol: name: acme-vol Loading @@ -63,6 +67,3 @@ secrets: cert-privkey: external: true cert-dhparam: external: true
scripts/entrypoint.sh 0 → 100755 +16 −0 Original line number Diff line number Diff line #!/bin/sh if [ -z "${PERSISTENT_PATH}" ] then echo "PERSISTENT_PATH variable should be defined!" exit 1 fi dhparamFile="${PERSISTENT_PATH}/dhparam.pem" if [ ! -e "${dhparamFile}" ] then echo "DHParam not found, generating.." openssl dhparam -out "${dhparamFile}" 4096 fi nginx -g 'daemon off;'