프로그래밍 툴/Docker

Docker(도커)-Dockerfile

험자 2020. 7. 21. 14:00

Dockerfile excerpted from Docker Up and Running

# Base layer to start the image build with
FROM node:0.10

# populates `Author` field in image's metadata
MAINTAINER Anna Doe <anna@example.com>

# populates `Config`/`Labels` fields
LABEL "rating"="Five Stars" "class"="First Class"

# By default, processes within container run as root
# recommended to switch to non-privileged user in production
USER root


ENV AP /data/app
ENV SCPATH /etc/supervisor/conf.d

RUN apt-get -y update

# the daemons
RUN apt-get -y install supervisor
RUN mkdir -p /var/log/supervisor

# Supervisor Configuration
# copy files from local filesystem into image
ADD ./supevisor/conf.d/* $SCPATH/

# Application Code
ADD *.js* $AP/

# change working directory in image to for the remaining build unless changed again.
WORKDIR $AP

RUN npm install

# command line that runs in image
CMD ["supervisord", "-n"]