-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDockerfile
41 lines (32 loc) · 863 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
34
35
36
37
38
39
40
41
# syntax=docker/dockerfile:experimental
# Build stage: Install yarn dependencies
# ===
FROM node:22 AS yarn-dependencies
WORKDIR /srv
COPY .yar[n] ./.yarn
COPY package.json yarn.lock .yarnrc.yml ./
ARG HTTP_PROXY
RUN if [ -n "$HTTP_PROXY" ]; then \
yarn config set httpProxy $HTTP_PROXY; \
fi
ARG HTTPS_PROXY
RUN if [ -n "$HTTPS_PROXY" ]; then \
yarn config set httpsProxy $HTTPS_PROXY; \
fi
RUN yarn install
# Build stage: Run "yarn run build-js"
# ===
FROM yarn-dependencies AS build-js
ADD . .
ARG BUILD_ID
RUN if [ -n "$BUILD_ID" ]; then \
cp public/config.demo.js public/config.js; \
fi
RUN yarn run build
FROM ubuntu:noble
RUN apt update && apt install --yes nginx
WORKDIR /srv
COPY nginx.conf /etc/nginx/sites-available/default
COPY entrypoint entrypoint
COPY --from=build-js /srv/build .
ENTRYPOINT ["./entrypoint"]