All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m55s
37 lines
No EOL
725 B
Docker
37 lines
No EOL
725 B
Docker
# Build stage
|
|
FROM oven/bun:latest as builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package.json bun.lock* ./
|
|
|
|
# Install all dependencies (including devDependencies for building)
|
|
RUN bun install --frozen-lockfile
|
|
|
|
# Copy source code and configuration files
|
|
COPY . .
|
|
|
|
# Build the application with Vite
|
|
RUN bun run build
|
|
|
|
# Production stage
|
|
FROM oven/bun:latest
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package.json bun.lock* ./
|
|
|
|
# Install only production dependencies
|
|
RUN bun install --frozen-lockfile --production
|
|
|
|
# Copy built application and server from build stage
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY src/server.ts ./src/server.ts
|
|
|
|
# Expose the port
|
|
EXPOSE 3000
|
|
|
|
# Start the application
|
|
CMD ["bun", "run", "prod"] |