Skip to content

Commit 5d8afbb

Browse files
rowanparkermaxhelias
authored andcommitted
Update build-css-js.md
1 parent f9d751a commit 5d8afbb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/build-css-js.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
This example uses `npm` and [Webpack Encore](https://symfony.com/doc/current/frontend.html).
44

55
Modify `Dockerfile` to build your assets before anything else.
6-
The output in `public/build` (the configuration default) will then be copied to both caddy and php.
7-
8-
In your production environment, this is all you need for an immutable release.
96

107
```diff
118
ARG CADDY_VERSION=2
@@ -23,6 +20,8 @@ ARG CADDY_VERSION=2
2320
# "php" stage
2421
```
2522

23+
Then copy the built output in `public/build` (the configuration default) to the `php` container (which will then be copied later to `caddy`).
24+
2625
```diff
2726
VOLUME /srv/app/var
2827

@@ -34,7 +33,8 @@ CMD ["php-fpm"]
3433
FROM caddy:${CADDY_VERSION}-builder-alpine AS symfony_caddy_builder
3534
```
3635

37-
Modify `docker-compose.override.yml` to add an `npm` container in your development environment and watch for file changes.
36+
Modify `docker-compose.override.yml` to add a `node` container in your development environment.
37+
This will provide you with hot module reloading.
3838

3939
```diff
4040
caddy:
@@ -54,3 +54,6 @@ Modify `docker-compose.override.yml` to add an `npm` container in your developme
5454
+ protocol: tcp
5555
+ command: 'sh -c "npm install; npm run dev-server -- --client-web-socket-url https://localhost:8080 --host 0.0.0.0"'
5656
```
57+
58+
If file changes are not picked up, refer to this page:
59+
https://symfony.com/doc/current/frontend/encore/virtual-machine.html#file-watching-issues

0 commit comments

Comments
 (0)