resource-portal / Dockerfile
Gowrisankar
Configure nginx to also listen on port 7860 for HF Spaces
17cddde
# Mirror of Containerfile — Hugging Face Spaces requires the filename "Dockerfile".
# If you edit this, edit Containerfile too (used by Podman on the office Linux box).
FROM python:3.12-slim AS backend-deps
WORKDIR /app/backend
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
FROM node:20-slim AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json .
RUN npm install
COPY frontend/ .
RUN npm run build
FROM python:3.12-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends nginx supervisor \
&& rm -rf /var/lib/apt/lists/*
COPY --from=backend-deps /usr/local/lib/python3.12 /usr/local/lib/python3.12
COPY --from=backend-deps /usr/local/bin /usr/local/bin
COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html
COPY backend/ /app/backend/
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervisord.conf /etc/supervisor/conf.d/portal.conf
RUN mkdir -p /data /run/nginx
VOLUME /data
EXPOSE 80 7860
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/portal.conf"]