2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【備忘録】Dockerを使ってBunを使って、Next.jsを起動する

Last updated at Posted at 2023-11-13

Dockerを使ってBunを使って、Next.jsを起動する

結論

nodeにBunいれた

きかっけ

巷で話題のBunを使いたい!

起こったこと

  1. BunのDockerイメージで構築→失敗
  2. 諦めてNodeで構築→成功?
  3. Nodeでnpmでbunをインストール→成功!

実際のコード

Dockerfile
FROM node:latest

WORKDIR /app

RUN npm install -g npm@latest

RUN npm install -g bun

RUN npm install create-next-app

RUN npm install && npm upgrade

EXPOSE 3000
docker-compose.yaml
version: '3'

services:
  front:
    build: ./front
    container_name: front
    tty: true
    ports:
      - "3000:3000"
    volumes:
      - ./front:/app
    working_dir: /app/各々のプロジェクト
    environment:
      - WATCHPACK_POLLING=true
    command: sh -c "bun run dev"

後はDocker動かす

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?