-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
40 lines (32 loc) · 946 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
33
34
35
36
37
38
39
40
# ---- Base Node ----
FROM --platform=linux/amd64 node:10.19.0 as base
WORKDIR /app
COPY package*.json ./
COPY bower.json ./
COPY .bowerrc ./
# ---- Dependencies ----
FROM base AS dependencies
COPY package*.json ./
COPY bower.json ./
COPY .bowerrc ./
RUN npm install -g bower
RUN bower install --allow-root
RUN npm install
# ---- Build ----
FROM dependencies AS build
COPY . .
RUN DEBUG= npm run build
# ---- Release ----
FROM --platform=linux/amd64 node:10.19.0 as release
WORKDIR /app
COPY --from=dependencies /app/node_modules /app/node_modules
COPY --from=dependencies /app/public/bower_components /app/public/bower_components
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/package-lock.json /app/package-lock.json
COPY --from=build /app/public/dist /app/public/dist
RUN npm ci --only=production
# remove development dependencies
RUN npm prune --production
COPY . .
EXPOSE 8001
CMD [ "node", "app.js" ]