-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.prod
54 lines (42 loc) · 1.46 KB
/
Dockerfile.prod
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
# Check out https://hub.docker.com/_/node to select a new base image
FROM node:18-slim AS builder
# Set to a non-root built-in user `node`
USER node
## Create app directory (with user `node`)
#RUN mkdir -p /home/node/app/nanowar-visualizer
#
#WORKDIR /home/node/app/nanowar-visualizer
#
## Install app dependencies (npm)
#COPY --chown=node nanowar-visualizer/package*.json ./
#
#RUN npm ci
#
## Bundle app source code
#COPY --chown=node nanowar-visualizer/. .
#
## Based on start.sh
#RUN npx ng build nanowar-visualizer
#RUN npx ng build nanowar-visualizer-app
#RUN cp -avr projects/nanowar-visualizer/src/assets dist/nanowar-visualizer-app/
# Create app directory (with user `node`)
RUN mkdir -p /home/node/app
WORKDIR /home/node/app
# Install app dependencies (yarn)
COPY --chown=node .yarn ./.yarn
COPY --chown=node .yarnrc.yml yarn.lock package.json ./
#RUN --mount=type=cache,target=/home/node/.yarn YARN_CACHE_FOLDER=/home/node/.yarn \
# yarn install --immutable
ARG NPM_AUTH_TOKEN
RUN yarn config set npmAuthToken ${NPM_AUTH_TOKEN}
RUN yarn install --immutable
# Bundle app source code
COPY --chown=node src ./src
COPY --chown=node angular.json package.json tsconfig.app.json tsconfig.json ./
RUN yarn run build
# Second stage
FROM nginx
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /home/node/app/dist/ai-arena-frontend /usr/share/nginx/html
EXPOSE 80
LABEL org.opencontainers.image.source https://github.com/a-gondolkodas-orome/ai-arena-frontend