File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 3
3
This example uses ` npm ` and [ Webpack Encore] ( https://symfony.com/doc/current/frontend.html ) .
4
4
5
5
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.
9
6
10
7
``` diff
11
8
ARG CADDY_VERSION=2
@@ -23,6 +20,8 @@ ARG CADDY_VERSION=2
23
20
# "php" stage
24
21
```
25
22
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
+
26
25
``` diff
27
26
VOLUME /srv/app/var
28
27
@@ -34,7 +33,8 @@ CMD ["php-fpm"]
34
33
FROM caddy:${CADDY_VERSION}-builder-alpine AS symfony_caddy_builder
35
34
```
36
35
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.
38
38
39
39
``` diff
40
40
caddy:
@@ -54,3 +54,6 @@ Modify `docker-compose.override.yml` to add an `npm` container in your developme
54
54
+ protocol: tcp
55
55
+ command: 'sh -c "npm install; npm run dev-server -- --client-web-socket-url https://localhost:8080 --host 0.0.0.0"'
56
56
```
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
You can’t perform that action at this time.
0 commit comments