Bake .env into build — env vars load from image at container start
This commit is contained in:
+1
-2
@@ -7,8 +7,7 @@ __pycache__
|
||||
*.pyc
|
||||
*.md
|
||||
*.txt
|
||||
.env
|
||||
.env.*
|
||||
.env.example
|
||||
!robots.txt
|
||||
*.xml
|
||||
!sitemap.xml
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user