Spaces:
Running
Running
File size: 926 Bytes
057a205 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | FROM python:3.11-slim
# Avoid buffering and bytecode issues
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=7860 \
SPHEREX_ALLOW_REMOTE=1
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create cache directories with full permissions for non-root container users (e.g. HF Spaces)
RUN mkdir -p /app/hips_cache /app/spherex_data /app/spherex_mosaics /tmp/spherex_cache && \
chmod -R 777 /app/hips_cache /app/spherex_data /app/spherex_mosaics /tmp/spherex_cache
# Copy application files (29 GB FITS data and caches are excluded via .dockerignore)
COPY . .
# Default container port (Hugging Face Spaces uses 7860)
EXPOSE 7860
# Launch server
CMD ["python3", "s.py"]
|