build(docker): fix dockerfile

This commit is contained in:
Melvin Chia
2026-01-10 09:20:10 +08:00
parent aaf1c0a428
commit 94ba028713
2 changed files with 20 additions and 4 deletions

View File

@@ -2,9 +2,17 @@
# ============================================
# Client Builder - On-demand client rebuilds
# Uses pre-built deps from lifeforge-deps image
# ============================================
FROM lifeforge-deps:latest
FROM oven/bun:alpine
WORKDIR /app
# Copy source
COPY . .
# Install all dependencies
RUN --mount=type=cache,target=/root/.bun/install/cache \
bun install --frozen-lockfile --ignore-scripts --linker isolated
# Set environment
ENV DOCKER_MODE=true

View File

@@ -7,13 +7,21 @@ FROM ghcr.io/muchobien/pocketbase:latest AS pocketbase
# ============================================
# DB Init Container - Generates and applies migrations
# Uses pre-built deps from lifeforge-deps image
# ============================================
FROM lifeforge-deps:latest
FROM oven/bun:alpine
# Copy PocketBase binary from official image
COPY --from=pocketbase /usr/local/bin/pocketbase /usr/local/bin/pocketbase
WORKDIR /app
# Copy source
COPY . .
# Install all dependencies
RUN --mount=type=cache,target=/root/.bun/install/cache \
bun install --frozen-lockfile --linker isolated
# Set environment for Docker mode
ENV DOCKER_MODE=true
ENV PB_DIR=/pb_data