From 433b77ee5d032d1920dde61e13efde2d006759e8 Mon Sep 17 00:00:00 2001 From: Andre Cobham Date: Thu, 4 Jun 2026 14:36:34 +0100 Subject: [PATCH] =?UTF-8?q?Bake=20.env=20into=20build=20=E2=80=94=20env=20?= =?UTF-8?q?vars=20load=20from=20image=20at=20container=20start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 3 +-- Dockerfile | 1 + infra/entrypoint.sh | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 5f51686..5cabdc7 100755 --- a/.dockerignore +++ b/.dockerignore @@ -7,8 +7,7 @@ __pycache__ *.pyc *.md *.txt -.env -.env.* +.env.example !robots.txt *.xml !sitemap.xml diff --git a/Dockerfile b/Dockerfile index 614eb7b..ed6c80e 100755 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ COPY robots.txt /var/www/html/robots.txt COPY sitemap.xml /var/www/html/sitemap.xml COPY 404.html /var/www/html/404.html COPY 500.html /var/www/html/500.html +COPY .env /var/www/html/.env RUN chown -R www-data:www-data /var/www/html diff --git a/infra/entrypoint.sh b/infra/entrypoint.sh index e24ab27..b20732c 100755 --- a/infra/entrypoint.sh +++ b/infra/entrypoint.sh @@ -1,5 +1,8 @@ #!/bin/sh set -e +if [ -f /var/www/html/.env ]; then + set -a; . /var/www/html/.env; set +a +fi if [ -z "$ALTCHA_HMAC_KEY" ]; then export ALTCHA_HMAC_KEY="$(openssl rand -hex 32)" echo "Generated ALTCHA_HMAC_KEY" >&2