-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (28 loc) · 948 Bytes
/
Dockerfile
File metadata and controls
35 lines (28 loc) · 948 Bytes
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
# Frontend for OpenCloning
# https://github.com/OpenCloning/OpenCloning_frontend
# Stage 1: Build the application
FROM node:22.22.2-alpine3.22 AS builder
WORKDIR /app
# Copy everything (Yarn workspaces need the full structure)
COPY . /app
RUN corepack enable
RUN yarn install --immutable
# Add build argument for base URL with a default value
ARG BASE_URL="/"
RUN yarn build --base "$BASE_URL"
# Stage 2: Create a lightweight production image
FROM node:22.22.2-alpine3.22
WORKDIR /build
COPY --from=builder /app/apps/opencloning/build .
# Install envsubst (to create config.json from config.env.json)
RUN apk add --no-cache envsubst
# Remove npm cache
RUN npm cache clean --force
COPY ./docker_entrypoint.sh /build/docker_entrypoint.sh
ENV BACKEND_URL=http://127.0.0.1:8000
ENV DATABASE=""
ENV SHOW_APP_BAR="true"
ENV NO_EXTERNAL_REQUESTS="false"
ENV ENABLE_ASSEMBLER="false"
ENV ENABLE_PLANNOTATE="false"
CMD ["sh", "docker_entrypoint.sh"]