Docker에서 Next.js with-typescript-eslint-jest

환경


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

도커 준비


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 명령 실행



템플릿 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 방문

좋은 웹페이지 즐겨찾기