-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile
30 lines (28 loc) · 890 Bytes
/
Dockerfile
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
30
# Node only packaging for the application
# Requires a MongoDB connection string.
# Scale node app horizontally as needed and setup a front-load balancer
#
# Choices:
# 1. Pass it using the DB_URI environmental variable. (uncomment line 20 and set the connection string)
#
# 2. Use Docker linking with alias = DB to link to a MongoDB Docker Container
# Sample: docker run <image> --link <dbContainer>:DB
FROM bitnami/node:8.6.0-r1 as builder
ENV NODE_ENV=production
WORKDIR /app
RUN npm install -g grunt-cli
ADD package.json /app/
RUN npm install
ADD . /app
RUN grunt release
RUN rm -rf public e2e.test api-invocation-samples docs test uploads
FROM bitnami/node:8.6.0-r1-prod
LABEL AUTHOR pjmolina.metadev.pro
ENV NODE_ENV=production
RUN mkdir -p /app
WORKDIR /app
COPY --from=builder /app .
ENV PORT=80
#ENV DB_URI=mongodb://<host>:<port>/<dbName>
EXPOSE 80
CMD ["npm", "start"]