Skip to content

Commit

Permalink
Fix docker compose on MacOS (#570)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fzaninotto authored Jul 2, 2024
1 parent 969ecc2 commit 56efa7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ ENV PORT 3000
COPY --link package.json yarn.lock .yarnrc.yml ./

RUN set -eux; \
yarn && yarn cache clean
yarn && yarn playwright install --with-deps && yarn cache clean

# copy sources
COPY --link . ./

RUN set -eux; \
yarn playwright install --with-deps && yarn cache clean

# Development image
FROM base as dev

Expand Down
4 changes: 3 additions & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
ENTRYPOINT: ${ENTRYPOINT:-https://localhost}
volumes:
- .:/srv/app
- pwa_node_modules:/srv/app/node_modules
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"]
interval: 10s
Expand All @@ -67,7 +68,7 @@ services:
ports:
- target: 3000
published: ${PWA_PORT:-3000}

###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-15}-alpine
Expand Down Expand Up @@ -98,3 +99,4 @@ volumes:
###< doctrine/doctrine-bundle ###
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
pwa_node_modules:

0 comments on commit 56efa7c

Please sign in to comment.