Files
Hoya26/frontend/Dockerfile
2026-01-26 10:11:17 +00:00

42 lines
686 B
Docker

# Build stage
FROM oven/bun:1 AS builder
WORKDIR /app
# Copy package files
COPY package.json ./
# Install dependencies
RUN bun install
# Copy source code
COPY . .
# Build the SvelteKit app
RUN bun run build
# Production stage
FROM oven/bun:1 AS production
WORKDIR /app
# Copy package.json and lockfile for production dependencies
COPY package.json ./
# Install only production dependencies
RUN bun install --production
# Copy built files from builder
COPY --from=builder /app/build ./build
COPY --from=builder /app/server ./server
# Expose port
EXPOSE 3000
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
# Start the server
CMD ["bun", "server/index.js"]