August 28, 2021
FROM ubuntu:18.04
# install nodejs
RUN apt-get -qq update
RUN apt-get -qq upgrade --yes
RUN apt-get -qq install curl --yes
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get -qq install nodejs --yes
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
사실 그냥 ubuntu에서 다운받는걸 똑같이 한다.
version: '3'
services:
server:
build: .
container_name: server_app
volumes:
- .:/usr/app/
- /usr/app/node_modules
command: npm run start:prod
보너스로 docker-compose.yml 파일이다