chatoai-backend / Dockerfile
Keyurjotaniya007's picture
backend at repo root for docker space
0a36812
Raw
History Blame Contribute Delete
827 Bytes
# ----------------------------------------------------------------------------
# oAI backend — container image for the search + RAG proxy.
# For a Hugging Face Docker Space this file must sit at the ROOT of the Space
# repo (next to README.md, server.js, package.json, and the src/ folder).
# ----------------------------------------------------------------------------
FROM node:20-slim
WORKDIR /app
# Install dependencies first (better layer caching).
COPY package*.json ./
RUN npm install --omit=dev
# App source.
COPY . .
# The embedding model (all-MiniLM, ~90 MB) is cached at runtime. On Hugging Face
# Spaces the app runs as a non-root user, so write the cache to /tmp (always
# writable) to avoid a "permission denied" error.
ENV MODEL_CACHE_DIR=/tmp/.models
ENV PORT=8787
EXPOSE 8787
CMD ["node", "server.js"]