-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (25 loc) · 972 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (25 loc) · 972 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
# syntax=docker/dockerfile:1
FROM oven/bun:1.3.14-alpine AS deps
WORKDIR /app
COPY package.json bun.lock bunfig.toml ./
COPY apps/web/package.json apps/web/
COPY apps/desktop/package.json apps/desktop/
COPY packages/tests/package.json packages/tests/
COPY packages/config/package.json packages/config/
# --ignore-scripts keeps electron's postinstall (a ~100MB binary download) out of the web image
RUN bun install --frozen-lockfile --ignore-scripts
FROM oven/bun:1.3.14-alpine AS build
WORKDIR /app
# Bun's isolated linker does NOT hoist: every workspace has its own node_modules.
# Copy the whole deps stage, never an enumerated list of node_modules dirs.
COPY --from=deps /app /app
COPY . .
RUN bun packages/tests/build.js
FROM oven/bun:1.3.14-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app /app
# Railway custom domains on the shared project are pinned to target port 8080.
ENV PORT=8080
EXPOSE 8080
CMD ["bun", "apps/web/src/main.js"]