Spaces:
Runtime error
Runtime error
Download Dockerfile from Junr-syl/qa_flaskapi: direct link, hf CLI and curl.
- Browser
- Download file 803 Bytes
-
https://huggingface.co/spaces/Junr-syl/qa_flaskapi/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Junr-syl/qa_flaskapi/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Junr-syl/qa_flaskapi/resolve/main/Dockerfile
803 Bytes
| # Use an official Python runtime as a parent image | |
| FROM python:3.9-slim-buster | |
| # Set environment variables for Flask | |
| ENV FLASK_APP=app.py | |
| ENV FLASK_RUN_HOST=0.0.0.0 | |
| ENV FLASK_ENV=production | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Set the Transformers cache directory to a writable location | |
| ENV TRANSFORMERS_CACHE=/app/transformers_cache | |
| # Create the cache directory and make it writable | |
| RUN mkdir -p $TRANSFORMERS_CACHE && chmod -R 777 $TRANSFORMERS_CACHE | |
| # Copy the current directory contents into the container at /app | |
| COPY . /app | |
| # Install any needed packages in requirements.txt | |
| RUN pip install pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Make port 7000-8000 available | |
| EXPOSE 7860 | |
| # run the Flask application | |
| CMD ["flask", "--app", "src/app.py", "run"] | |