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
|
||||
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
|
||||
# {$SERVER_NAME:localhost}; a bare ":8000" (no hostname) makes it listen
|
||||
|
||||
Reference in new issue
Block a user