42ff3e8f33
Build & Deploy / Test & Lint (push) Has been cancelled
Build & Deploy / Security Scan (push) Has been cancelled
Code Quality / Code Quality Checks (push) Has been cancelled
Code Quality / Dependency Vulnerabilities (push) Has been cancelled
Code Quality / Performance Testing (push) Has been cancelled
Build & Deploy / Build Docker Images (push) Has been cancelled
Build & Deploy / Deploy to Kubernetes (push) Has been cancelled
42 lines
867 B
Docker
42 lines
867 B
Docker
# Backend Dockerfile - Bun Runtime with Hono Framework
|
|
# Optimized for production deployment
|
|
|
|
FROM oven/bun:latest as builder
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy backend source code
|
|
COPY Mode3Test/backend ./backend
|
|
COPY Mode3Test/package.json .
|
|
COPY Mode3Test/bunfig.toml .
|
|
|
|
# Install dependencies
|
|
RUN bun install --production
|
|
|
|
# Build step (if needed)
|
|
# RUN bun run build
|
|
|
|
# Runtime stage
|
|
FROM oven/bun:latest
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy from builder
|
|
COPY --from=builder /app ./
|
|
|
|
# Set environment variables
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3005
|
|
ENV LOG_LEVEL=info
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD bun run --eval "fetch('http://localhost:3005/health').then(r => r.status === 200 ? process.exit(0) : process.exit(1))" || exit 1
|
|
|
|
# Expose port
|
|
EXPOSE 3005
|
|
|
|
# Start application
|
|
CMD ["bun", "run", "dev"]
|