AI-Syntax / Dockerfile
Hariprasath5128's picture
Prepare Syntax AI for Hugging Face Space
8a5fc23
raw
history blame contribute delete
701 Bytes
FROM node:18 AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PORT=7860
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY --chown=user ai_agent.py server.py ./
COPY --chown=user frontend ./frontend
COPY --from=frontend-build --chown=user /app/frontend/build ./frontend/build
EXPOSE 7860
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]