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?

More than 1 year has passed since last update.

docker メモ用紙

Last updated at Posted at 2023-07-16

Containerの削除 rm

docker rm test -fv

docker build -t test . 

docker run 
    -d 
    -v ${pwd}:/usr/src/app 
    -v data:/usr/src/app/node_modules 
    --name test 
    -p 3000:4000 
    --env-file ./.env 
    test

Dockerfile

Dockerfile
    FROM node:alpine3.18
    
    WORKDIR /usr/src/app
    
    COPY package.json .
    
    RUN npm install
    
    COPY . ./
    
    ENV PORT=3000
    
    EXPOSE ${PORT}
    
    CMD [ "npm", "run", "dev" ]

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?