-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
32 lines (26 loc) · 873 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
FROM node:14.15.0-slim as build
RUN apt-get update -qq && apt-get upgrade -qq \
&& apt-get clean autoclean && apt-get autoremove -y \
&& rm -rf \
/var/lib/cache \
/var/lib/log
WORKDIR /crisp-bigquery/server
COPY --chown=node:node ./server/ .
RUN yarn
WORKDIR /crisp-bigquery/client
COPY --chown=node:node ./client/ .
COPY --chown=node:node ./.env .
RUN yarn && yarn build:prod
FROM build as prod
WORKDIR /crisp-bigquery
COPY --chown=node:node ./key.json .
WORKDIR /crisp-bigquery/server
COPY --chown=node:node ./server/ .
COPY --from=build --chown=node:node /crisp-bigquery/client/config/ /crisp-bigquery/server/config/
RUN yarn && yarn compile
COPY --from=build --chown=node:node /crisp-bigquery/client/dist/ /crisp-bigquery/server/build/client/static/
EXPOSE 3000
ENV NODE_ENV=production
STOPSIGNAL SIGTERM
USER node
CMD ["node", "./build/srv/main.js"]