diff --git a/docker-compose.main.yml b/docker-compose.main.yml index 5781ec1c8d..1e01c9567c 100644 --- a/docker-compose.main.yml +++ b/docker-compose.main.yml @@ -48,7 +48,7 @@ services: environment: FMTM_DOMAIN: ${FMTM_DOMAIN} FMTM_API_DOMAIN: ${VITE_API_URL:-api.${FMTM_DOMAIN}} - FMTM_SCRIPT_DOMAIN: ${FMTM_SCRIPT_DOMAIN:-localhost} + FMTM_SCRIPT_DOMAIN: ${FMTM_SCRIPT_DOMAIN} ports: - 80:80 - 443:443 @@ -152,7 +152,7 @@ services: environment: FMTM_DOMAIN: ${FMTM_DOMAIN} FMTM_API_DOMAIN: ${FMTM_API_DOMAIN:-${VITE_API_URL:-api.${FMTM_DOMAIN}}} - FMTM_SCRIPT_DOMAIN: ${FMTM_SCRIPT_DOMAIN:-localhost} + FMTM_SCRIPT_DOMAIN: ${FMTM_SCRIPT_DOMAIN} CERT_EMAIL: ${CERT_EMAIL} ports: - 80:80 diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 18c4bafc25..6f8b094cb2 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -98,7 +98,7 @@ COPY templates/dev/fmtm.conf.template \ FROM base as certs-init-main # Replace existing /docker-entrypoint.sh -COPY 100-renew-certs.sh /docker-entrypoint.sh +COPY container-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh COPY templates/cert-init/fmtm.conf.template \ templates/cert-init/api.conf.template \ @@ -107,13 +107,8 @@ COPY templates/cert-init/fmtm.conf.template \ -FROM base as certs-init-development -# Replace existing /docker-entrypoint.sh -COPY container-entrypoint.sh /docker-entrypoint.sh -RUN chmod +x /docker-entrypoint.sh -COPY templates/cert-init/fmtm.conf.template \ - templates/cert-init/api.conf.template \ - templates/cert-init/odk.conf.template \ +FROM certs-init-main as certs-init-development +COPY templates/cert-init/odk.conf.template \ templates/cert-init/minio.conf.template \ /etc/nginx/templates/ diff --git a/nginx/container-entrypoint.sh b/nginx/container-entrypoint.sh index e40cc49648..fe19542313 100644 --- a/nginx/container-entrypoint.sh +++ b/nginx/container-entrypoint.sh @@ -68,9 +68,9 @@ certbot --non-interactive certonly "${certbot_args[@]}" echo "Certificate generated under: /etc/letsencrypt/live/${FMTM_DOMAIN}/" # Add FMTM_SCRIPT_DOMAIN if present -if [ -n "${FMTM_SCRIPT_DOMAIN}" ] && [ "${FMTM_SCRIPT_DOMAIN}" != "localhost" ]; then +if [ -n "${FMTM_SCRIPT_DOMAIN}" ]; then echo - echo "FMTM_SCRIPT_DOMAIN variable set and not equal to 'localhost'. Generating separate certificate." + echo "FMTM_SCRIPT_DOMAIN variable set. Generating separate certificate." certbot --non-interactive certonly \ --webroot --webroot-path=/var/www/certbot \ --email "${CERT_EMAIL}" --agress-tos --no-eff-email \