-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (31 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
43 lines (31 loc) · 1.17 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
# Stage 1: Build the application
FROM oven/bun:1 AS builder
WORKDIR /app
ARG APP_VERSION=dev
ENV APP_VERSION=${APP_VERSION}
# Copy root package files
COPY package.json bun.lock ./
# Copy package-specific package.json files
COPY packages/backend/package.json ./packages/backend/
COPY packages/frontend/package.json ./packages/frontend/
COPY packages/shared/package.json ./packages/shared/
# Install dependencies
RUN bun install --frozen-lockfile
# Copy the rest of the source code
COPY . .
# Build the frontend and compile everything into a single self-contained binary.
# Frontend assets (HTML, JS, CSS, images) and migration SQL files are all embedded
# inside the binary via `bun build --compile` — no runtime file copies needed.
RUN bun run compile:linux
# Stage 2: Minimal production image — just the binary
FROM debian:bookworm-slim
WORKDIR /app
# Copy the compiled binary from the builder stage
COPY --from=builder /app/plexus-linux ./plexus
# Environment variables
ENV LOG_LEVEL=info
ENV DATA_DIR=/app/data
ENV DATABASE_URL=sqlite:///app/data/plexus.db
ENV CONFIG_FILE=/app/config/plexus.yaml
# ADMIN_KEY must be provided at runtime (no default for security)
CMD ["./plexus"]