fixed frontend build
This commit is contained in:
1 parent
26185e51ef
commit
34f463071f
2 files changed
+30
-2
No files matched your search
@@ -13,8 +13,26 @@ RUN echo "date.timezone = Europe/Berlin" > $PHP_INI_DIR/conf.d/timezone.ini
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN composer install --no-interaction --no-dev --optimize-autoloader \
|
|
||||||
&& php bin/console cache:clear --env=prod --no-debug
|
# Symfony's dotenv bootstrap (SymfonyRuntime) unconditionally looks for
|
||||||
|
# .env/.env.dist on every boot. Real config (DATABASE_URL etc.) is injected
|
||||||
|
# as actual container env vars at runtime instead (see docker-compose.yaml's
|
||||||
|
# env_file), which doesn't exist yet at build time — an empty placeholder
|
||||||
|
# just satisfies dotenv's file-exists check; real env vars always take
|
||||||
|
# precedence over anything (not) found in it.
|
||||||
|
RUN touch .env \
|
||||||
|
&& composer install --no-interaction --no-dev --optimize-autoloader
|
||||||
|
|
||||||
|
# cache:clear needs real config (DATABASE_URL) to compile the container, so
|
||||||
|
# it can't run here at build time — it runs at container start instead, via
|
||||||
|
# this entrypoint, once env_file has actually been applied.
|
||||||
|
COPY docker-entrypoint.prod.sh /usr/local/bin/docker-entrypoint.prod.sh
|
||||||
|
RUN chmod +x /usr/local/bin/docker-entrypoint.prod.sh
|
||||||
|
ENTRYPOINT ["docker-entrypoint.prod.sh"]
|
||||||
|
# Docker resets CMD to empty whenever a Dockerfile sets a new ENTRYPOINT,
|
||||||
|
# even without touching CMD — restate the base image's own default here or
|
||||||
|
# the wrapper above execs with no arguments and FrankenPHP never starts.
|
||||||
|
CMD ["--config", "/etc/frankenphp/Caddyfile", "--adapter", "caddyfile"]
|
||||||
|
|
||||||
# Caddy's default site address in the base image's Caddyfile is
|
# Caddy's default site address in the base image's Caddyfile is
|
||||||
# {$SERVER_NAME:localhost}; a bare ":8000" (no hostname) makes it listen
|
# {$SERVER_NAME:localhost}; a bare ":8000" (no hostname) makes it listen
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Real config (DATABASE_URL etc.) only exists as actual container env vars
|
||||||
|
# at this point — injected via docker-compose.yaml's env_file — not during
|
||||||
|
# the image build, so cache-warming has to happen here instead of a RUN
|
||||||
|
# step in Dockerfile.prod.
|
||||||
|
php bin/console cache:clear --env=prod --no-debug
|
||||||
|
|
||||||
|
exec docker-php-entrypoint "$@"
|
||||||
Reference in new issue
Block a user