-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (32 loc) · 959 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
31
32
# Node Image -- Alternatively can use https://github.com/keymetrics/docker-pm2/blob/master/tags/latest/jessie/Dockerfile
FROM node:current
# Labels & metadata
LABEL version="latest"
LABEL name="today-web"
LABEL description="Image for today web app"
LABEL maintainer="Prashanth R <https://github.com/prashanthr>"
# OS Upgrades & Dependencies
RUN apt-get update && apt-get dist-upgrade -y
RUN apt-get install apt-utils -y && apt-get install net-tools vim curl -y
RUN apt-get clean
# Install Yarn
# RUN npm install -g yarn
# Set env
ENV WORK_DIR=/var/www/deploy/app
ENV NODE_ENV=production
ENV PORT=9000
# Workdir
RUN mkdir -p ${WORK_DIR}
WORKDIR ${WORK_DIR}
# package handling
ADD package*.json ${WORK_DIR}
ADD yarn.lock ${WORK_DIR}
RUN yarn --${NODE_ENV}
# Install App Dependencies
COPY . ${WORK_DIR}
# Build the front end assets
RUN yarn build
# Run application
CMD ["./node_modules/.bin/pm2-runtime", "start", "ecosystem.json"]
# Expose port
EXPOSE ${PORT}