Switch to using Docker file deployment

This commit is contained in:
Peter Stockings
2026-01-01 16:29:57 +11:00
parent 3a651c5bc8
commit 061f25fdcb
4 changed files with 42 additions and 17 deletions

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
# Use the official Bun image
FROM oven/bun:1.1.3
# Set working directory
WORKDIR /app
# Copy package files first for caching
COPY package.json bun.lockb ./
COPY packages/client/package.json ./packages/client/
COPY packages/server/package.json ./packages/server/
COPY packages/shared/package.json ./packages/shared/
# Install dependencies
RUN bun install --frozen-lockfile
# Copy the rest of the application
COPY . .
# Build the client (Vite) and server (TSC)
# ensuring the environment variables are set for the build if needed
ENV NODE_ENV=production
RUN bun --filter "*" build
# Expose the port (Dokku will override PORT env var, but 3000 is a good default documentation)
EXPOSE 3000
# Start the server
CMD ["bun", "packages/server/src/index.ts"]