Skip to content

Commit 56efa7c

Browse files
authored
Fix docker compose on MacOS (#570)
* Fix docker compose on MacOS ## Problem When calling `docker compose up`, the `pwa` service fails with a strange error on MacOS: ``` pwa-1 | yarn run v1.22.22 pwa-1 | $ storybook dev -p 3000 pwa-1 | /bin/sh: 1: storybook: not found pwa-1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. pwa-1 | error Command failed with exit code 127. ``` It seems the container doesn't find the node_modules at all. ## Solution Add a second volume for the node_modules. * Fix formatting
1 parent 969ecc2 commit 56efa7c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ ENV PORT 3000
2020
COPY --link package.json yarn.lock .yarnrc.yml ./
2121

2222
RUN set -eux; \
23-
yarn && yarn cache clean
23+
yarn && yarn playwright install --with-deps && yarn cache clean
2424

2525
# copy sources
2626
COPY --link . ./
2727

28-
RUN set -eux; \
29-
yarn playwright install --with-deps && yarn cache clean
30-
3128
# Development image
3229
FROM base as dev
3330

compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ services:
5858
ENTRYPOINT: ${ENTRYPOINT:-https://localhost}
5959
volumes:
6060
- .:/srv/app
61+
- pwa_node_modules:/srv/app/node_modules
6162
healthcheck:
6263
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"]
6364
interval: 10s
@@ -67,7 +68,7 @@ services:
6768
ports:
6869
- target: 3000
6970
published: ${PWA_PORT:-3000}
70-
71+
7172
###> doctrine/doctrine-bundle ###
7273
database:
7374
image: postgres:${POSTGRES_VERSION:-15}-alpine
@@ -98,3 +99,4 @@ volumes:
9899
###< doctrine/doctrine-bundle ###
99100
###> symfony/mercure-bundle ###
100101
###< symfony/mercure-bundle ###
102+
pwa_node_modules:

0 commit comments

Comments
 (0)