Document how to add npm (or yarn)
As per https://github.com/dunglas/symfony-docker/issues/129
@maxhelias do you think we can merge this one?
I unresolve some of the suggested changes because they have not been apply, unless that has changed and I apologize.
I unresolve some of the suggested changes because they have not been apply, unless that has changed and I apologize.
Sorry, I forgot all about this PR. I've accepted the suggested changes!
@dunglas Like that, it seems fair to me
I tried the suggested configuration but HMR not working. What configuration did I missed ?
If you are using symfony ux, you can encounter an issue with dependencies located in vendor not found.
error Package "" refers to a non-existing file '"/srv/app/vendor/symfony/ux-chartjs/Resources/assets"'.
I'm working on a fix, that copy vendor volume from php image to the temporary node and then copy the build result to caddy but any help would be welcome
If you are using symfony ux, you can encounter an issue with dependencies located in vendor not found.
error Package "" refers to a non-existing file '"/srv/app/vendor/symfony/ux-chartjs/Resources/assets"'.I'm working on a fix, that copy vendor volume from php image to the temporary node and then copy the build result to caddy but any help would be welcome
If you did not solve it yourself already, I solved it like this:
## pre stage "php_build" (notice this is not the final stage, it will be used as a base for the final stage later on)
FROM php:${PHP_VERSION}-fpm-alpine AS symfony_php_build
# ... original lines ...
## final stage "node"
FROM node:${NODE_VERSION}-alpine AS symfony_node
WORKDIR /srv/app
# this COPY makes sure we get all files including vendor from the `symfony_php_build` stage
COPY --from=symfony_php_build /srv/app .
RUN yarn install
## If you are building your code for production
# RUN npm ci --only=production
RUN yarn run build
## final stage "php"
FROM symfony_php_build AS symfony_php
COPY --from=symfony_node /srv/app/public/build public/build
## final stage "caddy"
# ... original lines ...
Any plans to fix and merger this?
I updated the PR to move forward on this topic, however the remark about Symfony UX is still valid, I haven't thought about the problem yet
In #271 I introduced a dev stage. Maybe could we install Node in this dev image?
Hi,
Thank you for this PR. I followed the steps and it works fine.
However, sometimes the url given after compilation starts with https://0.0.0.0 instead of the expected https://localhost:8080.
Have I missed something?
Regards.
Also, another issue I have:
failed to solve: executor failed running [/bin/sh -c npm install --force]: exit code: 254 make: *** [Makefile:25: build] Error 17
It started to appear when I added Symfony UX dependencies.
These deps add new entries in packages.json that are not available as composer install is called later.
"@symfony/ux-chartjs": "file:vendor/symfony/ux-chartjs/assets", "@symfony/ux-live-component": "file:vendor/symfony/ux-live-component/assets",
Any ideas on how to solve this?
Hi @Spomky,
Hum, It's been a while since I took up the subject and I remember that Symfony UX packages were a problem for the compilation.
For SymfonyUX, I think we should rethink the approach with either making a new build stage or including nodejs in the dev stage
Hello @maxhelias
Hereafter a working configuration for NPM, heavily inspired by the work of @CedricHerzog in #365 (with some extra parameters). The host/port issue in https://github.com/dunglas/symfony-docker/pull/186#issuecomment-1415984664 is still there, but now it is building successfully.
--- Dockerfile 2023-02-05 09:59:06.335530332 +0100
+++ Dockerfile 2023-02-05 10:01:48.285534169 +0100
@@ -4,6 +4,11 @@
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
# https://docs.docker.com/compose/compose-file/#target
+ARG PHP_VERSION=8.2
+ARG CADDY_VERSION=2.6
+ARG NODE_VERSION=19
+
+
# Builder images
FROM composer/composer:2-bin AS composer
@@ -19,7 +24,7 @@
--with github.com/dunglas/vulcain/caddy
# Prod image
-FROM php:8.2-fpm-alpine AS app_php
+FROM php:${PHP_VERSION}-fpm-alpine AS app_composer
# Allow to use development versions of Symfony
ARG STABILITY="stable"
@@ -101,6 +106,22 @@
chmod +x bin/console; sync; \
fi
+# node "stage"
+FROM node:${NODE_VERSION}-alpine AS symfony_node
+
+COPY --link --from=app_composer /srv/app /app/
+
+WORKDIR /app
+
+RUN npm install --force
+RUN npm run build
+## If you are building your code for production
+# RUN npm ci --only=production
+
+FROM app_composer AS app_php
+COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
+
+
# Dev image
FROM app_php AS app_php_dev
@@ -119,10 +140,11 @@
RUN rm -f .env.local.php
# Caddy image
-FROM caddy:2.6-alpine AS app_caddy
+FROM caddy:${CADDY_VERSION}-alpine AS app_caddy
WORKDIR /srv/app
COPY --from=app_caddy_builder --link /usr/bin/caddy /usr/bin/caddy
COPY --from=app_php --link /srv/app/public public/
COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile
+COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
For anyone trying to get this to work:
- Use these changes: https://github.com/dunglas/symfony-docker/pull/186#issuecomment-1417158348
- Modify
.dockerignoreanddocker-compose.override.ymlas per the PR contents - Change the volume for the node container in
docker-compose.override.ymlfrom./:/srv/appto./:/app~~Sorry, huge misunderstanding on my part on how webpack dev-server works. Seems to be an issue with what files are being watched however.~~ Seems to work fine after all, but the node container command needs to have--public https://localhost:8080added to it. Hot Module Reloading seems to not work.
Managed to get this to work with HMR as well:
- Follow the steps in my last comment
- Change node container command in
docker-compose.override.ymlto'sh -c "npm install; npm run dev-server -- --server-type https --client-web-socket-url https://localhost:8080/ws --host 0.0.0.0 --public https://localhost:8080"'
Haven't tested the config in production yet.
Hi @packagespace,
I confirm it works fine in a dev env. You rock! I don't have any opportunity to push it in production as this template is only used for a local context. In addition to the proposed change here above, I also followed the steps described in this thread. It could be great if this repository could also take advantages if the suggested modifications in this PR. WDYT?
@Spomky Thanks for the feedback. I'll have a chance to try it in production soon but since the build seems to work fine in the node stage I don't think there will be any issues.
I looked at the thread you linked and I'm curious about a few things now (bear in mind I'm not very experienced with Docker and node):
- Is it necessary to copy the entire
/srv/appdirectory to the node image?- I understand that copying
package*.jsonis not sufficient due to the Symfony UX deps needing some files in/vendor, but what if we copied onlypackage*.jsonand/vendor? - I imagine
/assetsandwebpack.config.jsare also needed for thenpm buildstep, could these also be copied explicitly after runningnpm installto avoid invalidating the cache? - Here's an attempt at it (unsure about my use of trailing slashes):
- I understand that copying
FROM node:${NODE_VERSION}-alpine AS symfony_node
COPY --link --from=app_composer /srv/app/package*.json /app/
COPY --link --from=app_composer /srv/app/vendor /app/vendor
WORKDIR /app
RUN npm install --force
COPY --link --from=app_composer /srv/app/assets /app/assets
COPY --link --from=app_composer /srv/app/webpack.config.js /app/
RUN npm run build
- I'm wondering about the necessity of having both
npm installandnpm ci --production-onlyin the Dockerfile. As far as I understand thenode_modulesfolder for this step is never copied to any other image? I suppose it would make sense if you wanted to have a node container in production? If that's the case, maybe it could be stated more explicitly?
It does not work, Any update or solution?
@lchhieu What's wrong? I tried it a while ago and everything worked fine. If you have any errors or concerns, don't hesitate to post them - it's hard to help you like this!
@lchhieu What's wrong? I tried it a while ago and everything worked fine. If you have any errors or concerns, don't hesitate to post them - it's hard to help you like this!
I tried add this code before caddy image but public/build does not copied
FROM app_php AS symfony_php
COPY --from=symfony_node /srv/app/public/build public/build
# Caddy image
FROM caddy:2-alpine AS app_caddy
I did it a few weeks, I followed this thread and found a way to make it work:
in Dockerfile
I changed the name of the base php image
# Prod image
- FROM php:8.2-fpm-alpine AS app_php
+ FROM php:${PHP_VERSION}-fpm-alpine AS app_composer
then under of all the PHP prod stage
# node "stage"
FROM node:${NODE_VERSION}-alpine AS symfony_node
COPY --link --from=app_composer /srv/app /app/
WORKDIR /app
RUN npm install --force
RUN npm run build
## If you are building your code for production
# RUN npm ci --only=production
FROM app_composer AS app_php
COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
and add this line at the bottom of Dockerfile (dont know if its relevant because we already had this line before):
COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
And in docker-compose.override.yml :
node:
build:
context: .
target: symfony_node
volumes:
- ./:/app
ports:
- target: 8080
published: 8080
protocol: tcp
command: 'sh -c "npm install; npm run dev-server -- --server-type https --client-web-socket-url https://localhost:8080/ws --host 0.0.0.0 --public https://localhost:8080"'
And you can had the versions envvar at the top of Dockerfile or elsewhere :
ARG PHP_VERSION=8.2
ARG CADDY_VERSION=2.6
ARG NODE_VERSION=19
In your case this line FROM app_php AS symfony_php is before caddy that's why it doesn't work, it has to be under the app_php stage.
@Jioleoo Could you give me your full Dockerfile. Although I followed your idea but public/build still not exist
ARG PHP_VERSION=8.2
ARG CADDY_VERSION=2.6
ARG NODE_VERSION=19
FROM caddy:2.7-builder-alpine AS app_caddy_builder
RUN xcaddy build v2.6.4 \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
# Prod image
FROM php:${PHP_VERSION}-fpm-alpine AS app_php
# Allow to use development versions of Symfony
ARG STABILITY="stable"
ENV STABILITY ${STABILITY}
# Allow to select Symfony version
ARG SYMFONY_VERSION=""
ENV SYMFONY_VERSION ${SYMFONY_VERSION}
ENV APP_ENV=prod
WORKDIR /srv/app
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
COPY --from=mlocati/php-extension-installer:latest --link /usr/bin/install-php-extensions /usr/local/bin/
# persistent / runtime deps
# hadolint ignore=DL3018
RUN apk add --no-cache \
acl \
fcgi \
file \
gettext \
git \
;
RUN set -eux; \
install-php-extensions \
apcu \
intl \
opcache \
zip \
;
###> recipes ###
###> doctrine/doctrine-bundle ###
RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \
docker-php-ext-install -j"$(nproc)" pdo_pgsql; \
apk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \
apk del .pgsql-deps
###< doctrine/doctrine-bundle ###
###< recipes ###
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf
RUN mkdir -p /var/run/php
COPY --link docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
RUN chmod +x /usr/local/bin/docker-healthcheck
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
COPY --link docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
COPY --from=composer/composer:2-bin --link /composer /usr/bin/composer
# prevent the reinstallation of vendors at every changes in the source code
COPY --link composer.* symfony.* ./
RUN set -eux; \
if [ -f composer.json ]; then \
composer install --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress; \
composer clear-cache; \
fi
# copy sources
COPY --link . ./
RUN rm -Rf docker/
RUN set -eux; \
mkdir -p var/cache var/log; \
if [ -f composer.json ]; then \
composer dump-autoload --classmap-authoritative --no-dev; \
composer dump-env prod; \
composer run-script --no-dev post-install-cmd; \
chmod +x bin/console; sync; \
fi
# Dev image
FROM app_php AS app_php_dev
ENV APP_ENV=dev XDEBUG_MODE=off
VOLUME /srv/app/var/
RUN rm "$PHP_INI_DIR/conf.d/app.prod.ini"; \
mv "$PHP_INI_DIR/php.ini" "$PHP_INI_DIR/php.ini-production"; \
mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
RUN set -eux; \
install-php-extensions \
xdebug \
;
RUN rm -f .env.local.php
# node "stage"
FROM node:${NODE_VERSION}-alpine AS symfony_node
COPY --link --from=app_php /srv/app /app/
WORKDIR /app
RUN npm install --force
RUN npm run build
## If you are building your code for production
# RUN npm ci --only=production
FROM app_php AS app_php_dev
COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
# Caddy image
FROM caddy:2-alpine AS app_caddy
WORKDIR /srv/app
COPY --from=app_caddy_builder --link /usr/bin/caddy /usr/bin/caddy
COPY --from=app_php --link /srv/app/public public/
COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
@lchhieu
#syntax=docker/dockerfile:1.4
# The different stages of this Dockerfile are meant to be built into separate images
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
# https://docs.docker.com/compose/compose-file/#target
ARG PHP_VERSION=8.2
ARG CADDY_VERSION=2.6
ARG NODE_VERSION=19
# Builder images
FROM composer/composer:2-bin AS composer
FROM mlocati/php-extension-installer:latest AS php_extension_installer
# Build Caddy with the Mercure and Vulcain modules
FROM caddy:${CADDY_VERSION}-builder-alpine AS app_caddy_builder
RUN xcaddy build \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain \
--with github.com/dunglas/vulcain/caddy
# Prod image
FROM php:${PHP_VERSION}-fpm-alpine AS app_composer
# Allow to use development versions of Symfony
ARG STABILITY="stable"
ENV STABILITY ${STABILITY}
# Allow to select Symfony version
ARG SYMFONY_VERSION=""
ENV SYMFONY_VERSION ${SYMFONY_VERSION}
ENV APP_ENV=prod
WORKDIR /srv/app
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
COPY --from=php_extension_installer --link /usr/bin/install-php-extensions /usr/local/bin/
# persistent / runtime deps
RUN apk add --no-cache \
acl \
fcgi \
file \
gettext \
git \
;
RUN set -eux; \
install-php-extensions \
apcu \
intl \
opcache \
zip \
;
###> recipes ###
###> doctrine/doctrine-bundle ###
RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \
docker-php-ext-install -j"$(nproc)" pdo_pgsql; \
apk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \
apk del .pgsql-deps
###< doctrine/doctrine-bundle ###
###< recipes ###
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf
RUN mkdir -p /var/run/php
COPY --link docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
RUN chmod +x /usr/local/bin/docker-healthcheck
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
COPY --link docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
COPY --from=composer --link /composer /usr/bin/composer
# prevent the reinstallation of vendors at every changes in the source code
COPY --link composer.* symfony.* ./
RUN set -eux; \
if [ -f composer.json ]; then \
composer install --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress; \
composer clear-cache; \
fi
# copy sources
COPY --link . ./
RUN rm -Rf docker/
RUN set -eux; \
mkdir -p var/cache var/log; \
if [ -f composer.json ]; then \
composer dump-autoload --classmap-authoritative --no-dev; \
composer dump-env prod; \
composer run-script --no-dev post-install-cmd; \
chmod +x bin/console; sync; \
fi
# node "stage"
FROM node:${NODE_VERSION}-alpine AS symfony_node
COPY --link --from=app_composer /srv/app /app/
WORKDIR /app
RUN npm install --force
RUN npm run build
## If you are building your code for production
# RUN npm ci --only=production
FROM app_composer AS app_php
COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
# Dev image
FROM app_php AS app_php_dev
ENV APP_ENV=dev XDEBUG_MODE=off
VOLUME /srv/app/var/
RUN rm "$PHP_INI_DIR/conf.d/app.prod.ini"; \
mv "$PHP_INI_DIR/php.ini" "$PHP_INI_DIR/php.ini-production"; \
mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
RUN set -eux; \
install-php-extensions \
xdebug \
;
RUN rm -f .env.local.php
# Caddy image
FROM caddy:${CADDY_VERSION}-alpine AS app_caddy
WORKDIR /srv/app
COPY --from=app_caddy_builder --link /usr/bin/caddy /usr/bin/caddy
COPY --from=app_php --link /srv/app/public public/
COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
Why not add node directly on php container ? Symfony at this stage has requered NODE and yarn. I can't see reason to not use node in dev container.
@rowanparker @dunglas @maxhelias Hello
Considering we have a working configuration for this as per @Spomky's and my comments (https://github.com/dunglas/symfony-docker/pull/186#issuecomment-1417158348 https://github.com/dunglas/symfony-docker/pull/186#issuecomment-1460112972 https://github.com/dunglas/symfony-docker/pull/186#issuecomment-1474810293 https://github.com/dunglas/symfony-docker/pull/186#issuecomment-1474858926), should we see if this PR can be modified and merged in order to avoid confusion as seen above?
If opening up a new PR would be easier to parse, I wouldn't mind taking care of it either.
Hi @packagespace,
I didn't really take the time for this topic but I reread the whole thread. I think opening a new PR with your work will be easier to analyze and compare.
Thanks for your time on this
@lchhieu
#syntax=docker/dockerfile:1.4 # The different stages of this Dockerfile are meant to be built into separate images # https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage # https://docs.docker.com/compose/compose-file/#target ARG PHP_VERSION=8.2 ARG CADDY_VERSION=2.6 ARG NODE_VERSION=19 # Builder images FROM composer/composer:2-bin AS composer FROM mlocati/php-extension-installer:latest AS php_extension_installer # Build Caddy with the Mercure and Vulcain modules FROM caddy:${CADDY_VERSION}-builder-alpine AS app_caddy_builder RUN xcaddy build \ --with github.com/dunglas/mercure \ --with github.com/dunglas/mercure/caddy \ --with github.com/dunglas/vulcain \ --with github.com/dunglas/vulcain/caddy # Prod image FROM php:${PHP_VERSION}-fpm-alpine AS app_composer # Allow to use development versions of Symfony ARG STABILITY="stable" ENV STABILITY ${STABILITY} # Allow to select Symfony version ARG SYMFONY_VERSION="" ENV SYMFONY_VERSION ${SYMFONY_VERSION} ENV APP_ENV=prod WORKDIR /srv/app # php extensions installer: https://github.com/mlocati/docker-php-extension-installer COPY --from=php_extension_installer --link /usr/bin/install-php-extensions /usr/local/bin/ # persistent / runtime deps RUN apk add --no-cache \ acl \ fcgi \ file \ gettext \ git \ ; RUN set -eux; \ install-php-extensions \ apcu \ intl \ opcache \ zip \ ; ###> recipes ### ###> doctrine/doctrine-bundle ### RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \ docker-php-ext-install -j"$(nproc)" pdo_pgsql; \ apk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \ apk del .pgsql-deps ###< doctrine/doctrine-bundle ### ###< recipes ### RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" COPY --link docker/php/conf.d/app.ini $PHP_INI_DIR/conf.d/ COPY --link docker/php/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/ COPY --link docker/php/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf RUN mkdir -p /var/run/php COPY --link docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck RUN chmod +x /usr/local/bin/docker-healthcheck HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"] COPY --link docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint RUN chmod +x /usr/local/bin/docker-entrypoint ENTRYPOINT ["docker-entrypoint"] CMD ["php-fpm"] # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser ENV COMPOSER_ALLOW_SUPERUSER=1 ENV PATH="${PATH}:/root/.composer/vendor/bin" COPY --from=composer --link /composer /usr/bin/composer # prevent the reinstallation of vendors at every changes in the source code COPY --link composer.* symfony.* ./ RUN set -eux; \ if [ -f composer.json ]; then \ composer install --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress; \ composer clear-cache; \ fi # copy sources COPY --link . ./ RUN rm -Rf docker/ RUN set -eux; \ mkdir -p var/cache var/log; \ if [ -f composer.json ]; then \ composer dump-autoload --classmap-authoritative --no-dev; \ composer dump-env prod; \ composer run-script --no-dev post-install-cmd; \ chmod +x bin/console; sync; \ fi # node "stage" FROM node:${NODE_VERSION}-alpine AS symfony_node COPY --link --from=app_composer /srv/app /app/ WORKDIR /app RUN npm install --force RUN npm run build ## If you are building your code for production # RUN npm ci --only=production FROM app_composer AS app_php COPY --from=symfony_node --link /app/public/build /srv/app/public/build/ # Dev image FROM app_php AS app_php_dev ENV APP_ENV=dev XDEBUG_MODE=off VOLUME /srv/app/var/ RUN rm "$PHP_INI_DIR/conf.d/app.prod.ini"; \ mv "$PHP_INI_DIR/php.ini" "$PHP_INI_DIR/php.ini-production"; \ mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" COPY --link docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/ RUN set -eux; \ install-php-extensions \ xdebug \ ; RUN rm -f .env.local.php # Caddy image FROM caddy:${CADDY_VERSION}-alpine AS app_caddy WORKDIR /srv/app COPY --from=app_caddy_builder --link /usr/bin/caddy /usr/bin/caddy COPY --from=app_php --link /srv/app/public public/ COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
Could you give me an example for branch master?
I tried this: COPY --from=symfony_node --link /app/public/build /srv/app/public/build/
But after build the public directory contains index.php only
Hi all,
Have we got anything new on this please?
Best,
Laurent
The reworking of the project for FrankenPHP calls this integration into question.
What's more, with the new AssetMapper component, it might be more interesting to concentrate on it.
Thank you for your contribution in spite of everything. And if anyone would like to try with AssetMapper, a PR is welcome.