Files
upload-gltf/Dockerfile
T
2026-04-27 17:20:13 +02:00

62 lines
1.6 KiB
Docker

# =============================================================================
# Upload GLTF — Dockerfile for Coolify
# Node 20 Debian · 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="La Fabrik Durable"
LABEL description="Secure GLTF upload interface with texture compression and GitHub push"
# Install runtime helpers
RUN apt-get update && apt-get install -y --no-install-recommends \
tini \
curl \
&& 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
# 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"]