File size: 845 Bytes
136a2c7
 
 
 
 
c4ccf87
 
136a2c7
c4ccf87
136a2c7
 
c4ccf87
 
 
7f463a7
 
 
136a2c7
 
 
 
 
 
 
 
 
 
 
 
 
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
# 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"]