-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (35 loc) · 1.39 KB
/
Dockerfile
File metadata and controls
54 lines (35 loc) · 1.39 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
44
45
46
47
48
49
50
51
52
53
54
FROM node:20-bookworm AS dev
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
git bash g++ make \
&& rm -rf /var/lib/apt/lists/*
RUN corepack enable
WORKDIR /code
RUN git config --global --add safe.directory /code
COPY package.json pnpm-lock.yaml /code/
RUN corepack prepare --activate
# RUN npm install -g pnpm
# RUN pnpm install
# -------------------------- Nginx - Builder --------------------------------
FROM dev AS nginx-build
COPY package.json pnpm-lock.yaml /code/
RUN corepack prepare --activate
RUN pnpm install
COPY . .
# # Build variables (Requires backend pulled)
ENV APP_TITLE=APP_TITLE_PLACEHOLDER
ENV APP_GRAPHQL_ENDPOINT=APP_GRAPHQL_ENDPOINT_PLACEHOLDER
ENV APP_GRAPHQL_CODEGEN_ENDPOINT=./backend/schema.graphql
RUN pnpm generate:type && pnpm build
# RUN pnpm build
# ---------------------------------------------------------------------------
FROM nginx:1 AS nginx-serve
LABEL maintainer="Togglecorp Dev"
LABEL org.opencontainers.image.source="https://github.com/toggle-corp"
COPY ./nginx-serve/apply-config.sh /docker-entrypoint.d/
COPY ./nginx-serve/nginx.conf.template /etc/nginx/templates/default.conf.template
COPY --from=nginx-build /code/build /code/build
# NOTE: Used by apply-config.sh
ENV APPLY_CONFIG__SOURCE_DIRECTORY=/code/build/
ENV APPLY_CONFIG__DESTINATION_DIRECTORY=/usr/share/nginx/html/
ENV APPLY_CONFIG__OVERWRITE_DESTINATION=true