# 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"]