Skip to content

Commit

Permalink
fix docker ci
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Mar 11, 2024
1 parent 09879f4 commit 45bb40b
Show file tree
Hide file tree
Showing 5 changed files with 15,789 additions and 11,045 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ jobs:
*.cache-to=type=gha,scope=${{github.ref}},mode=max
-
name: Start services
run: docker compose up --wait --no-build
run: docker compose -f compose.yaml -f compose.ci.yaml up --wait --no-build
-
name: Check HTTP reachability
run: curl -v --fail-with-body http://localhost
-
name: Check API reachability
run: curl -vk --fail-with-body https://localhost
-
name: Check PWA reachability
run: "curl -vk --fail-with-body -H 'Accept: text/html' https://localhost"
-
name: Check API reachability
run: "curl -vk --fail-with-body -H 'Accept: application/ld+json' https://localhost"
-
name: Create test database
run: docker compose exec -T php bin/console -e test doctrine:database:create
Expand Down
23 changes: 17 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@ RUN apk add --no-cache libc6-compat
WORKDIR /srv/app

RUN corepack enable && \
corepack prepare --activate pnpm@latest && \
pnpm config -g set store-dir /.pnpm-store

# Development image
FROM base as dev
corepack prepare --activate yarn@*

EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME localhost

CMD ["sh", "-c", "pnpm install; pnpm storybook"]
# Development image
FROM base as dev

CMD ["sh", "-c", "yarn install; yarn storybook"]

FROM base as ci

COPY --link package.json yarn.lock ./
RUN set -eux; \
yarn

# copy sources
COPY --link . ./
RUN yarn storybook:build

CMD ["yarn", "serve"]
5 changes: 5 additions & 0 deletions compose.ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
pwa:
build:
context: .
target: ci
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"react-dom": "^18.0.0",
"react-test-renderer": "^18.0.0",
"rimraf": "^5.0.0",
"serve": "^14.2.1",
"storybook": "^7.5.3",
"ts-jest": "^29.0.0",
"ts-node": "^10.4.0",
Expand All @@ -85,6 +86,7 @@
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch src",
"watch": "tsc --watch",
"storybook": "storybook dev -p 3000",
"build-storybook": "storybook build"
"storybook:build": "storybook build",
"storybook:serve": "serve storybook-static"
}
}
Loading

0 comments on commit 45bb40b

Please sign in to comment.