Skip to content

Commit

Permalink
feat: add docker image build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mimokmt committed Mar 1, 2024
1 parent 9dd3fff commit 5dac6e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/node_modules
**/dist
storybook-static
docker
.yarn/cache
.yarn/install-state.gz
.vscode
.git
7 changes: 0 additions & 7 deletions docker/storybook-server/.dockerignore

This file was deleted.

8 changes: 5 additions & 3 deletions docker/storybook-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# syntax = docker/dockerfile:1.3
FROM node
RUN apt update && apt install -y gcc
RUN npx playwright install-deps
RUN mkdir /workspace && chown node /workspace
RUN npm install -g http-server concurrently wait-on
USER node
RUN npx playwright install
WORKDIR /workspace
COPY --chown=node:node . /workspace
RUN yarn install --immutable --inline-builds
RUN yarn playwright install
RUN --mount=type=cache,target=/workspace/.yarn/cache/,uid=1000,gid=1000 \
yarn install --immutable --inline-builds
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.cache/ms-playwright \
yarn playwright install
RUN yarn build
RUN yarn storybook:build --quiet
CMD http-server storybook-static --port 6006 --silent

0 comments on commit 5dac6e5

Please sign in to comment.