-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 807 Bytes
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM alpine:latest
MAINTAINER Alvaro Reguly
LABEL Description="This image is used to start a sample node.js app on port 3000" Vendor="Alvaro Reguly" Version="1.0"
# Update
RUN apk upgrade --update \
&& apk add --no-cache --update nodejs-lts ca-certificates \
&& apk add --no-cache --update --virtual .build-deps g++ \
&& rm -rf /var/cache/apk/*
# Install app and dependencies
ADD .npmrc /root/.npmrc
# install first to take advantage of Docker layers to cache the npm install
ADD package.json /app/
WORKDIR /app
RUN npm install
#RUN npm install && npm install -g pm2
# Delete things that were only needed by npm install
RUN apk del .build-deps \
&& rm -rf /root/.npm
# Now add app code
ADD . /app
EXPOSE 3000
CMD [ "node", "index.js" ]
#CMD ["pm2", "start", "pm2-processes.json", "--no-daemon"]