0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

メモ|モノレポのStorybookをdocker-composeで動作させる

Posted at

モノレポのStorybookをdocker-composeで動作させたときの、ファイルメモ
Windows, docker desktop, hotreloadあり

./docker-compose.yml
services:
  storybook:
    build:
      context: ./UiLbrary
      dockerfile: ./DockerfileDev
    tty: true
    environment:
      - WATCHPACK_POLLING=true
    ports:
      - "6006:6006"
    volumes:
      - ./UiLbrary:/usr/src/app
      - /usr/src/app/node_modules
    command: npm run storybook
./storybook/Dockerfile
# ベースイメージとして node を使用
FROM node:20-alpine AS build

# 作業ディレクトリを設定
WORKDIR /usr/src/app

# 必要なパッケージをインストール
RUN apk add --no-cache xdg-utils

# package.json と package-lock.json をコピー
COPY package*.json ./

# 依存関係をインストール
RUN npm install

# ソースコードをコピー
COPY . .

# node_modules を削除して再インストール
RUN rm -rf node_modules && npm install

# Storybook を起動
CMD ["npm", "run", "storybook"]
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?