zai / Dockerfile
sanbo110's picture
update sth at 2026-01-15 15:33:59
f78578c
raw
history blame contribute delete
685 Bytes
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Create data and logs directories with proper permissions
# HuggingFace Spaces runs as non-root user, need proper permissions
RUN mkdir -p /app/data /app/logs /app/app/static/css /app/app/static/js && \
chmod -R 777 /app/data /app/logs /app/app/static
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Set environment variables
ENV DB_PATH=/app/data/tokens.db
ENV LISTEN_PORT=7860
ENV SKIP_AUTH_TOKEN=true
ENV ANONYMOUS_MODE=true
# Expose HuggingFace Spaces default port
EXPOSE 7860
# Run the application
CMD ["python", "main.py"]