-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 804 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (24 loc) · 804 Bytes
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
# build environment
FROM node:18 as base
FROM base AS deps
WORKDIR /app
COPY package.json ./
COPY yarn.lock* ./
RUN yarn install
# 2. Rebuild the source code only when needed
FROM base AS builder
ARG BUILD_ENV=production
WORKDIR /app
COPY . ./
# https://create-react-app.dev/docs/adding-custom-environment-variables#what-other-env-files-can-be-used
COPY envs/.env.${BUILD_ENV} .env
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build
# production environment
FROM nginx:stable as runner
COPY --from=builder /app/dist /usr/share/nginx/html
RUN mkdir -p /usr/share/nginx/html/bvm-website-sats-iframe
COPY --from=builder /app/dist /usr/share/nginx/html/bvm-website-sats-iframe
COPY etc/nginx/nginx-docker.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]