build(docker): remove web frontend build dependencies

- Remove web package.json install steps from Dockerfiles
- Remove web/dist copy from production build
- Remove web_node_modules volume from docker-compose
This commit is contained in:
syntaxbullet
2026-02-08 16:41:56 +01:00
parent 36f9c76fa9
commit 20284dc57b
3 changed files with 2 additions and 18 deletions

View File

@@ -16,11 +16,9 @@ FROM base AS deps
# Copy only package files first (better layer caching)
COPY package.json bun.lock ./
COPY web/package.json web/bun.lock ./web/
# Install all dependencies in one layer
RUN bun install --frozen-lockfile && \
cd web && bun install --frozen-lockfile
# Install dependencies
RUN bun install --frozen-lockfile
# ============================================
# Development stage - for local dev with volume mounts
@@ -29,7 +27,6 @@ FROM base AS development
# Copy dependencies from deps stage
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/web/node_modules ./web/node_modules
# Expose ports
EXPOSE 3000
@@ -44,7 +41,6 @@ FROM base AS production
# Copy dependencies from deps stage
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/web/node_modules ./web/node_modules
# Copy source code
COPY . .

View File

@@ -11,16 +11,9 @@ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# Install web project dependencies
COPY web/package.json web/bun.lock ./web/
RUN cd web && bun install --frozen-lockfile
# Copy source code
COPY . .
# Build web assets for production
RUN cd web && bun run build
# =============================================================================
# Stage 2: Production Runtime
# =============================================================================
@@ -34,8 +27,6 @@ WORKDIR /app
# Copy only what's needed for production
COPY --from=builder --chown=bun:bun /app/node_modules ./node_modules
COPY --from=builder --chown=bun:bun /app/web/node_modules ./web/node_modules
COPY --from=builder --chown=bun:bun /app/web/dist ./web/dist
COPY --from=builder --chown=bun:bun /app/web/src ./web/src
COPY --from=builder --chown=bun:bun /app/bot ./bot
COPY --from=builder --chown=bun:bun /app/shared ./shared

View File

@@ -36,7 +36,6 @@ services:
- .:/app
# Use named volumes for node_modules (prevents host overwrite + caches deps)
- app_node_modules:/app/node_modules
- web_node_modules:/app/web/node_modules
environment:
- HOST=0.0.0.0
- DB_USER=${DB_USER}
@@ -92,5 +91,3 @@ volumes:
# Named volumes for node_modules caching
app_node_modules:
name: aurora_app_node_modules
web_node_modules:
name: aurora_web_node_modules