Config files for my server. Except not my secrets
1#########
2# BUILD #
3#########
4FROM node:24-alpine AS build
5WORKDIR /app
6
7RUN apk add git
8
9# install pnpm
10ENV PNPM_HOME="/pnpm"
11ENV PATH="$PNPM_HOME:$PATH"
12RUN corepack enable pnpm && corepack install -g pnpm@latest
13
14# dong web
15FROM build AS build-dong
16WORKDIR /app
17RUN git clone https://tangled.org/vielle.dev/dong-web.git /app/dong
18RUN pnpm --dir /app/dong install --prod
19RUN pnpm --dir /app/dong run build --outDir /app/dong/dist
20
21# saltire
22FROM build AS build-saltire
23WORKDIR /app
24RUN git clone https://tangled.org/vielle.dev/saltire-the-gays.git /app/saltire
25RUN pnpm --dir /app/saltire install --prod
26RUN pnpm --dir /app/saltire run build --outDir /app/saltire/dist
27
28# astral powers
29FROM build AS build-dnd
30WORKDIR /app
31RUN git clone https://tangled.org/vielle.dev/dnd-astral-powers.git /app/dnd
32RUN pnpm --dir /app/dnd install --prod
33RUN pnpm --dir /app/dnd run build --outDir /app/dnd/dist
34
35#########
36# CADDY #
37#########
38FROM caddy:2.10.2
39
40# copy built files to /srv
41COPY ./Caddyfile /etc/caddy/Caddyfile
42COPY ./srv /srv
43COPY --from=build-dong /app/dong/dist /srv/dong
44COPY --from=build-saltire /app/saltire/dist /srv/saltire
45COPY --from=build-dnd /app/dnd/dist /srv/dnd
46
47CMD caddy run --config /etc/caddy/Caddyfile --adapter caddyfile