30 lines
511 B
Docker
30 lines
511 B
Docker
# Build stage
|
|
FROM oven/bun:1 AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json bun.lock* ./
|
|
RUN bun install
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the Astro site
|
|
RUN bun run build
|
|
|
|
# Production stage
|
|
FROM oven/bun:1-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built files and node_modules
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/package.json ./
|
|
|
|
# Expose port
|
|
EXPOSE 4321
|
|
|
|
# Start the Astro server
|
|
CMD ["bun", "./dist/server/entry.mjs"]
|