forked from syntaxbullet/aurorabot
Remove the 'production' stage from Dockerfile that was: - Duplicating functionality already in Dockerfile.prod - Incorrectly running 'bun run dev' instead of production command VPS deployments continue to use Dockerfile.prod as the single source of truth for production builds. Development Dockerfile now only contains development stage.
36 lines
993 B
Docker
36 lines
993 B
Docker
# ============================================
|
|
# Base stage - shared configuration
|
|
# ============================================
|
|
FROM oven/bun:latest AS base
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies with cleanup in same layer
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends git && \
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
# ============================================
|
|
# Dependencies stage - installs all deps
|
|
# ============================================
|
|
FROM base AS deps
|
|
|
|
# Copy only package files first (better layer caching)
|
|
COPY package.json bun.lock ./
|
|
|
|
# Install dependencies
|
|
RUN bun install --frozen-lockfile
|
|
|
|
# ============================================
|
|
# Development stage - for local dev with volume mounts
|
|
# ============================================
|
|
FROM base AS development
|
|
|
|
# Copy dependencies from deps stage
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
|
|
# Expose ports
|
|
EXPOSE 3000
|
|
|
|
# Default command
|
|
CMD ["bun", "run", "dev"]
|