| # base image for Python | |
| FROM python:3.9-slim | |
| # set working directory in container ์ปจํ ์ด๋ ๋ด ์์ ๋๋ ํ ๋ฆฌ ์ค์ | |
| WORKDIR /app | |
| # Copy the current directory contents into the container at /app | |
| COPY . /app | |
| # Install any needed packages specified in requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Set the TRANSFORMERS_CACHE environment variable | |
| ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub | |
| # Create the cache directory with appropriate permissions | |
| RUN mkdir -p /app/.cache/huggingface/hub && \ | |
| chmod -R 777 /app/.cache | |
| # Expose the port the app runs on | |
| EXPOSE 7860 | |
| # Define environment variable | |
| ENV FLASK_APP=app.py | |
| # Run the application | |
| CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"] | |
| ## Hugging Face Spaces๋ ํฌํธ 7860์ ์ฌ์ฉ | |
| #ENV PORT 7860 | |
| ## set command | |
| #CMD ["python", "app.py"] | |