LoginSignup
1
0

More than 3 years have passed since last update.

Dockerfile
FROM node:latest # version指定 docker inspect => "NODE_VERSION=11.14.0"
EXPOSE 7000      # port 7000 を開ける
ENV HOST 0.0.0.0 # container に どのipaddressでも接続できる<=これ無しだと、接続できない。ipaddressが違う?
docker-compose.yml
version: "3"  
services:
  web:
    build: .      #<= ./ でも同じ
    volumes:
      - ".:/app"  #<= ./:/app でも同じ <= host:container
    ports:
      - 7000:3000 #<= ホストで7000を開くとコンテナの3000につながる。バインディング。Dockerfileと揃える
    container_name: "nuxt-sandbox"
    tty: true     #<= 入力を受け付ける

上の二つを同じフォルダに置いて、

docker-compose up -d
// -d ありだと、バックグラウンド起動、無しだと、ターミナル上で起動します
docker exec -itnuxt-sandbox bash
yarn create nuxt-app <project-name>
1
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
1
0