##環境
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H524
Docker version 20.10.5, build 55c4c88
docker-compose version 1.28.5, build c4eb3a1f
##Docker準備
FROM node:14.16.1-alpine3.13
WORKDIR /usr/src/app
docker-compose.yml
version: '3'
services:
node:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/usr/src/app
command: sh -c "cd app && npm run dev"
ports:
- '3000:3000'
##create-next-appコマンドをインストール
$ docker-compose run --rm node npm install create-next-app
##create-next-appコマンドを実行
templateをwith-typescript-eslint-jest
プロジェクト名をapp
$ docker-compose run --rm node npx create-next-app --example with-typescript-eslint-jest app
##docker-compose up
$ docker-compose up
http://localhost:3000 にアクセス