🤖

Angular docker

2021/12/10に公開約500字

Dockerfile

FROM node

RUN mkdir /usr/src/app

COPY package.json package-lock.json ./

WORKDIR /usr/src/app/

RUN npm install -g @angular/cli

EXPOSE 4200

COPY . .

docker-compose.yml

version: '3'

services:
    app:
        container_name: app
        build: ./
        ports:
            - '4200:4200'
        command: bash -sh "npm install --force && ng serve --host 0.0.0.0 --port 4200"

.dockerignore

dist

node_modules

e2e

.gitignore

*.md

Command

$ docker-compose up --build
$ docker-compose run app
# npm i
# npm run start

Discussion

ログインするとコメントできます