Spaces:
Sleeping
Sleeping
Download Dockerfile from fromnowoncoding/eventinvite: direct link, hf CLI and curl.
- Browser
- Download file 948 Bytes
-
https://huggingface.co/spaces/fromnowoncoding/eventinvite/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/fromnowoncoding/eventinvite/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/fromnowoncoding/eventinvite/resolve/main/Dockerfile
948 Bytes
| FROM python:3.11-slim | |
| WORKDIR /code | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first to leverage Docker cache | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Create data directory with correct permissions | |
| RUN mkdir -p /data && \ | |
| chmod -R 777 /data && \ | |
| chown -R 1000:1000 /data | |
| # Copy the rest of the application | |
| COPY . /code/ | |
| # Set code directory permissions | |
| RUN chmod -R 777 /code && \ | |
| chown -R 1000:1000 /code | |
| # Create instance directory with correct permissions | |
| RUN mkdir -p /code/instance && \ | |
| chmod -R 777 /code/instance && \ | |
| chown -R 1000:1000 /code/instance | |
| # Switch to non-root user | |
| USER 1000:1000 | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| # Run the application with proper permissions | |
| CMD ["python", "app.py"] | |