65 lines
1.7 KiB
Docker
65 lines
1.7 KiB
Docker
# =============================================================================
|
|
# Asset Bridge 3D — Dockerfile for Coolify
|
|
# Node 20 Debian · Blender (headless) · Multi-stage build
|
|
# =============================================================================
|
|
|
|
# --- Stage 1: Dependencies ---------------------------------------------------
|
|
FROM node:20-slim AS deps
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci --ignore-scripts
|
|
|
|
# --- Stage 2: Build ----------------------------------------------------------
|
|
FROM node:20-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
ENV NODE_ENV=production
|
|
|
|
RUN npm run build
|
|
|
|
# --- Stage 3: Production -----------------------------------------------------
|
|
FROM node:20-slim AS runner
|
|
|
|
LABEL maintainer="Asset Bridge 3D"
|
|
LABEL description="Secure 3D asset upload interface with Draco compression and GitHub push"
|
|
|
|
# Install Blender (headless) + tini
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
blender \
|
|
tini \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
ENV PORT=3000
|
|
ENV HOSTNAME=0.0.0.0
|
|
|
|
# Copy build artifacts
|
|
COPY --from=builder /app/.next/standalone ./
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
COPY --from=builder /app/public ./public
|
|
|
|
# Copy the Blender compression script
|
|
COPY --from=builder /app/scripts ./scripts
|
|
|
|
# Ensure tmp dir for uploads exists
|
|
RUN mkdir -p /tmp/assets
|
|
|
|
# Copy entrypoint
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
EXPOSE 3000
|
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--", "/docker-entrypoint.sh"]
|
|
CMD ["node", "server.js"]
|