forked from helxplatform/helx-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 843 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
33
###################
# Build environment
###################
FROM node:18.16-alpine AS builder
ARG REACT_APP_WORKSPACES_ENABLED=true
ENV REACT_APP_WORKSPACES_ENABLED=$REACT_APP_WORKSPACES_ENABLED
# Copy and install requirements
WORKDIR /usr/src/app
COPY --chown=node:node "package*.json" /usr/src/app/
RUN npm i -g npm@latest
RUN npm ci
COPY --chown=node:node . /usr/src/app
RUN npm run build
########################
# Production environment
########################
FROM nginx:latest
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /usr/src/app/build/ /usr/share/nginx/static/
RUN mv /usr/share/nginx/static/frontend/index.html /usr/share/nginx/html/
WORKDIR /usr/src/app
COPY bin /usr/src/app/bin
ENV PATH="/usr/src/app/bin:${PATH}"
EXPOSE 80
CMD ["start_server", "/usr/share/nginx/static/frontend/env.json"]