forked from syntaxbullet/aurorabot
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:
@@ -16,11 +16,9 @@ FROM base AS deps
|
|||||||
|
|
||||||
# Copy only package files first (better layer caching)
|
# Copy only package files first (better layer caching)
|
||||||
COPY package.json bun.lock ./
|
COPY package.json bun.lock ./
|
||||||
COPY web/package.json web/bun.lock ./web/
|
|
||||||
|
|
||||||
# Install all dependencies in one layer
|
# Install dependencies
|
||||||
RUN bun install --frozen-lockfile && \
|
RUN bun install --frozen-lockfile
|
||||||
cd web && bun install --frozen-lockfile
|
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# Development stage - for local dev with volume mounts
|
# Development stage - for local dev with volume mounts
|
||||||
@@ -29,7 +27,6 @@ FROM base AS development
|
|||||||
|
|
||||||
# Copy dependencies from deps stage
|
# Copy dependencies from deps stage
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps /app/web/node_modules ./web/node_modules
|
|
||||||
|
|
||||||
# Expose ports
|
# Expose ports
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
@@ -44,7 +41,6 @@ FROM base AS production
|
|||||||
|
|
||||||
# Copy dependencies from deps stage
|
# Copy dependencies from deps stage
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps /app/web/node_modules ./web/node_modules
|
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
@@ -11,16 +11,9 @@ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|||||||
COPY package.json bun.lock ./
|
COPY package.json bun.lock ./
|
||||||
RUN bun install --frozen-lockfile
|
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 source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build web assets for production
|
|
||||||
RUN cd web && bun run build
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Stage 2: Production Runtime
|
# Stage 2: Production Runtime
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -34,8 +27,6 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Copy only what's needed for production
|
# 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/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/web/src ./web/src
|
||||||
COPY --from=builder --chown=bun:bun /app/bot ./bot
|
COPY --from=builder --chown=bun:bun /app/bot ./bot
|
||||||
COPY --from=builder --chown=bun:bun /app/shared ./shared
|
COPY --from=builder --chown=bun:bun /app/shared ./shared
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ services:
|
|||||||
- .:/app
|
- .:/app
|
||||||
# Use named volumes for node_modules (prevents host overwrite + caches deps)
|
# Use named volumes for node_modules (prevents host overwrite + caches deps)
|
||||||
- app_node_modules:/app/node_modules
|
- app_node_modules:/app/node_modules
|
||||||
- web_node_modules:/app/web/node_modules
|
|
||||||
environment:
|
environment:
|
||||||
- HOST=0.0.0.0
|
- HOST=0.0.0.0
|
||||||
- DB_USER=${DB_USER}
|
- DB_USER=${DB_USER}
|
||||||
@@ -92,5 +91,3 @@ volumes:
|
|||||||
# Named volumes for node_modules caching
|
# Named volumes for node_modules caching
|
||||||
app_node_modules:
|
app_node_modules:
|
||||||
name: aurora_app_node_modules
|
name: aurora_app_node_modules
|
||||||
web_node_modules:
|
|
||||||
name: aurora_web_node_modules
|
|
||||||
|
|||||||
Reference in New Issue
Block a user