mirror of
https://github.com/SirBlobby/Hoya26.git
synced 2026-02-04 03:34:34 -05:00
42 lines
686 B
Docker
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"]
|