Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 1.46 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (30 loc) · 1.46 KB
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
FROM node:22-bookworm AS dev
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/* \
# NOTE: yarn > 1.22.19 breaks yarn-install invoked by pnpm
&& npm install -g pnpm@10.33.0 yarn@1.22.19 --force \
&& git config --global --add safe.directory /code
WORKDIR /code
# -------------------------- Builder ----------------------------------
FROM dev AS builder
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
--mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
pnpm install --frozen-lockfile --store-dir /pnpm/store
COPY . /code/
# -------------------------- Nginx - Builder --------------------------------
FROM builder AS web-app-serve-build
# # Build variables (Requires backend pulled)
ENV APP_TITLE=ercs-cms
ENV APP_ENVIRONMENT=development
ENV APP_GRAPHQL_ENDPOINT=http://localhost:8000
ENV APP_GRAPHQL_CODEGEN_ENDPOINT=./backend/schema.graphql
RUN pnpm generate:type && WEB_APP_SERVE_ENABLED=true pnpm build
# ---------------------------------------------------------------------------
FROM ghcr.io/toggle-corp/web-app-serve:v0.1.2 AS web-app-serve
LABEL maintainer="Togglecorp Dev"
LABEL org.opencontainers.image.source="https://github.com/ToogleCorp/ercs-cms"
# Env for apply-config script
ENV APPLY_CONFIG__SOURCE_DIRECTORY=/code/build/
COPY --from=web-app-serve-build /code/build "$APPLY_CONFIG__SOURCE_DIRECTORY"