forked from InseeFrLab/BootcampJS-JS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
18 lines (17 loc) · 675 Bytes
/
Dockerfile
File metadata and controls
18 lines (17 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# build environment
FROM node:14.16.0-alpine as build
WORKDIR /app
COPY package.json yarn.lock .env ./
RUN yarn install --frozen-lockfile
COPY . .
RUN NODE_OPTIONS="--max-old-space-size=4096" yarn build
# production environment
FROM nginx:stable-alpine
RUN apk add --update nodejs npm
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/node_modules/react-envs/package.json ./re.json
RUN npm i -g react-envs@`node -e 'console.log(require("./re.json")["version"])'`
WORKDIR /usr/share/nginx
COPY --from=build /app/build ./html
COPY --from=build /app/.env .
ENTRYPOINT sh -c "npx embed-environnement-variables && nginx -g 'daemon off;'"