forked from kbss-cvut/termit-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (26 loc) · 899 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
# BASE STAGE
# Prepare node, copy package.json
FROM node:16-alpine AS base
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
# DEPENDENCIES STAGE
# Install production and dev dependencies
FROM base AS dependencies
# install node packages
#RUN npm set progress=false && npm config set depth 0
RUN npm install --legacy-peer-deps
# BUILD STAGE
# run NPM build
FROM dependencies as build
# If an app is supposed to be deployed in a subdir, this is the place to specify that
# Make sure that React app is built using the right path context
COPY . .
RUN set -ex; \
npm run build
# RELEASE STAGE
# Only include the static files in the final image
FROM ghcr.io/datagov-cz/react-nginx/react-nginx:latest
COPY --from=build /usr/src/app/build /usr/share/nginx/html
RUN chmod a+r -R /usr/share/nginx/html
RUN chmod ag+x /usr/share/nginx/html/flags
RUN chmod ag+x /usr/share/nginx/html/background