- Dockerfile: node:22-bookworm-slim + Python venv with trimesh for the 3MF->GLB sidecar (PYTHON_BIN env points the converter at it) - docker-compose.yml: app + postgres 16 with healthcheck/depends_on, named volumes for pgdata/uploads/thumbnails/glb, token env passthrough - .dockerignore, tools/requirements.txt - converter.js honours PYTHON_BIN (defaults to local venv) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
873 B
Docker
30 lines
873 B
Docker
# Printhive — Node app + Python/trimesh sidecar (for 3MF -> GLB conversion)
|
|
FROM node:22-bookworm-slim
|
|
|
|
# Python is needed at runtime for the 3MF->GLB / volume sidecar.
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends python3 python3-venv \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Tell the converter where Python lives (the venv built below).
|
|
ENV PYTHON_BIN=/app/tools/venv/bin/python
|
|
|
|
# Python sidecar deps (cached unless requirements.txt changes).
|
|
COPY tools/requirements.txt ./tools/requirements.txt
|
|
RUN python3 -m venv /app/tools/venv \
|
|
&& /app/tools/venv/bin/pip install --no-cache-dir -r tools/requirements.txt
|
|
|
|
# Node deps (cached unless package files change).
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
# App source.
|
|
COPY . .
|
|
|
|
ENV NODE_ENV=production \
|
|
PORT=3000
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", "server.js"]
|