-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
40 lines (26 loc) · 970 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
# syntax=docker/dockerfile:experimental
FROM node:16.5.0 AS deps
WORKDIR /data/blotter_page
# deps cache
COPY ./package.json ./yarn.lock ./
RUN yarn install --frozen-lockfile
FROM node:16.5.0 AS builder
WORKDIR /data/blotter_page
# build code
COPY ./ /data/blotter_page
COPY --from=deps /data/blotter_page/node_modules ./node_modules
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline
FROM node:16.5.0 AS prod_deps
WORKDIR /data/blotter_page
# deps cache
COPY ./package.json ./yarn.lock ./
RUN yarn install --frozen-lockfile --prod
FROM node:16.5.0 AS prod
ENV backendURI="http://backend:50000"
WORKDIR /data/blotter_page
ENTRYPOINT [ "yarn", "start" ]
# dev cache
COPY --from=prod_deps /data/blotter_page/package.json /data/blotter_page/yarn.lock ./
COPY --from=prod_deps /data/blotter_page/node_modules ./node_modules
COPY --from=builder /data/blotter_page/next.config.js ./
COPY --from=builder /data/blotter_page/.next ./.next