Axion / Dockerfile
Mr-Thop's picture
Update Dockerfile
74f6581 verified
raw
history blame contribute delete
836 Bytes
FROM python:3.10
# Prevent Python from writing pyc files
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Create a non-root user (HF Spaces compatible)
RUN useradd -m -u 1000 backenduser
USER backenduser
# Set PATH
ENV PATH="/home/backenduser/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Copy requirements first (better caching)
COPY --chown=backenduser:backenduser requirements.txt /app/requirements.txt
# Install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy backend source code
COPY --chown=backenduser:backenduser . /app
# Create required runtime directories
RUN mkdir -p \
resume \
uploads \
temp \
logs
COPY --chown=user . /app
CMD ["gunicorn", "app:app", "--timeout", "180", "-w", "3", "--bind", "0.0.0.0:7860"]