forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBc35a83aBurak Boduroğlu4 months ago440 commits

Containerfile26 lines, 823 bytesHistoryRawDownload
1# Build the SPA, then serve the static bundle with Bun (which also reverse-
2# proxies /api to the backend — see server.ts). No nginx: one runtime, one
3# tool, same-origin preserved.
4
5FROM docker.io/oven/bun:1 AS build
6WORKDIR /app
7COPY package.json bun.lock ./
8RUN --mount=type=cache,target=/root/.bun/install/cache \
9 bun install --frozen-lockfile
10COPY . .
11RUN bun run build
12
13FROM docker.io/oven/bun:1-slim AS serve
14WORKDIR /app
15# Only the built assets and the server script are needed at runtime; server.ts
16# imports nothing but Bun built-ins, so there are no node_modules to copy.
17COPY --from=build /app/dist ./dist
18COPY server.ts ./server.ts
19
20ENV PORT=5173
21EXPOSE 5173
22USER bun
23
24# Healthcheck lives in compose.yaml (podman's OCI image format ignores a
25# Containerfile HEALTHCHECK).
26CMD ["bun", "run", "server.ts"]