-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
99 lines (83 loc) · 2.83 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# syntax=docker/dockerfile:1.3
FROM node:14-bullseye as dependencies
# CI
ARG CI
ENV CI=${CI:-1}
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
openjdk-11-jdk \
# needed for puppeteer peer dep
# on arm64
chromium \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# make the 'app' folder the current working directory
WORKDIR /app
COPY package.json yarn.lock /app/
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk
ENV PATH="$JAVA_HOME/bin:${PATH}"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# install project and build
RUN CYPRESS_INSTALL_BINARY=0 yarn install --network-timeout 1000000 && yarn cache clean
# build stage
FROM node:14-bullseye as build
WORKDIR /app
# CI/General
ARG CI
ENV CI=${CI:-1}
ENV CYPRESS_INSTALL_BINARY 0
# Stage Specific Args
ARG VUE_APP_API_BASE_URL
ARG VUE_APP_BASE_URL
ARG VUE_APP_WS_URL
ARG VUE_APP_STAGE
ARG VUE_APP_AWS_CCP_URL
ARG VUE_APP_CCP_INSTANCE
ARG VUE_APP_PORTAL_KEY
ARG NODE_ENV
# Stage Env
ENV VUE_APP_API_BASE_URL=${VUE_APP_API_BASE_URL}
ENV VUE_APP_BASE_URL=${VUE_APP_BASE_URL}
ENV VUE_APP_WS_URL=${VUE_APP_WS_URL}
ENV VUE_APP_STAGE=${VUE_APP_STAGE}
ENV VUE_APP_AWS_CCP_URL=${VUE_APP_AWS_CCP_URL}
ENV VUE_APP_CCP_INSTANCE=${VUE_APP_CCP_INSTANCE}
ENV VUE_APP_PORTAL_KEY=${VUE_APP_PORTAL_KEY:-crisiscleanup_us}
ENV NODE_ENV=${NODE_ENV:-production}
# Secrets Args
ARG VUE_APP_WHAT_3_WORDS_API_KEY
ARG VUE_APP_GOOGLE_MAPS_API_KEY
ARG VUE_APP_PITNEYBOWES_API_KEY
ARG VUE_APP_PITNEYBOWES_BASIC_AUTH_TOKEN
ARG VUE_APP_PHONE_DEFAULT_USERNAME
ARG VUE_APP_PHONE_DEFAULT_PASSWORD
ARG VUE_APP_ENGLISH_PHONE_GATEWAY
ARG VUE_APP_SPANISH_PHONE_GATEWAY
ARG VUE_APP_DEFAULT_CALLER_ID
ARG SENTRY_DSN
ARG SENTRY_AUTH_TOKEN
ARG SENTRY_PROPERTIES
# Secrets env
ENV VUE_APP_WHAT_3_WORDS_API_KEY=${VUE_APP_WHAT_3_WORDS_API_KEY}
ENV VUE_APP_GOOGLE_MAPS_API_KEY=${VUE_APP_GOOGLE_MAPS_API_KEY}
ENV VUE_APP_PITNEYBOWES_API_KEY=${VUE_APP_PITNEYBOWES_API_KEY}
ENV VUE_APP_PITNEYBOWES_BASIC_AUTH_TOKEN=${VUE_APP_PITNEYBOWES_BASIC_AUTH_TOKEN}
ENV VUE_APP_DEFAULT_CALLER_ID=${VUE_APP_DEFAULT_CALLER_ID}
ENV VUE_APP_PHONE_DEFAULT_USERNAME=${VUE_APP_PHONE_DEFAULT_USERNAME}
ENV VUE_APP_PHONE_DEFAULT_PASSWORD=${VUE_APP_PHONE_DEFAULT_PASSWORD}
ENV VUE_APP_ENGLISH_PHONE_GATEWAY=${VUE_APP_ENGLISH_PHONE_GATEWAY}
ENV VUE_APP_SPANISH_PHONE_GATEWAY=${VUE_APP_SPANISH_PHONE_GATEWAY}
ENV SENTRY_DSN=${SENTRY_DSN}
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
ENV SENTRY_PROPERTIES=${SENTRY_PROPERTIES:-"sentry.properties"}
COPY --from=dependencies /app/node_modules ./node_modules
COPY . .
ENV NODE_OPTIONS='--max_old_space_size=4096'
RUN yarn build --mode=${VUE_APP_STAGE}
# production stage
FROM nginx:stable-alpine as production-stage
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]