Commit f7cb4c5d authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Incorpora generación de dhparam

parent 2e39d7f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
*
!nginx/**/*
!scripts/**/*
+6 −0
Original line number Diff line number Diff line
@@ -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
+8 −7
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ version: '3.5'
services:
  nginx-proxy:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    environment:
      - PERSISTENT_PATH
    networks:
      - traefik-net
    ports:
@@ -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:
@@ -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
@@ -38,7 +39,7 @@ services:
        window: 2m
      resources:
        limits:
          cpus: '4'
          cpus: '2'
          memory: 128M
        reservations:
          memory: 103M
@@ -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
@@ -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;'