2018-10-2 Frank
Dockerfile
# First build
FROM keymetrics/pm2:8-alpine
WORKDIR /app
# Install python
RUN apk add --update \
python \
python-dev \
py-pip \
build-base
# Bundle APP files
COPY . /app
#ONBUILD COPY . /app
# Install app dependencies
ENV NPM_CONFIG_LOGLEVEL warn
RUN npm i -g cnpm
RUN cnpm install --production
# Show current folder structure in logs
RUN ls -al -R
EXPOSE 3000
CMD [ "pm2-runtime", "start", "pm2.json" ]
# Second build
#FROM lb4-example
#COPY . /app
#RUN cnpm i --production
Makefile
docker-build :
docker build -t lb4-example .
docker-run :
docker run -d -p 3000:3000 --name lb4-example lb4-example:latest
docker-exec :
docker exec -it lb4-example sh
docker-rm :
docker rm -f lb4-example
发表评论 登录: