forked from WoWAnalyzer/WoWAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod-full
25 lines (18 loc) · 910 Bytes
/
Dockerfile.prod-full
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
FROM node:8.2.1-alpine
# We don't use this approach because it results in a docker image that's 150MB larger than required since every single line (command) below creates a new "layer" in the container where all data that is written in that line gets stored and this data can never be removed. The preferred way to make a production image is using the default prod file, but that requires preparation outside the dockerfile.
# Normally Docker sets this, now you need to. You can do this without changing this file with the -e argument.
ENV WCL_API_KEY=INSERT_YOUR_OWN_API_KEY_HERE
# App
WORKDIR /usr/src/wowanalyzer
# By doing this separate we allow Docker to cache this
COPY package.json package-lock.json /usr/src/wowanalyzer/
RUN npm install
COPY . /usr/src/wowanalyzer/
RUN npm run build
# Server
WORKDIR ./server/
RUN npm install
RUN npm run build
EXPOSE 3000
USER node
CMD ["npm", "run", "serve"]