Switch to using Docker file deployment
This commit is contained in:
28
Dockerfile
Normal file
28
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user