sentiment / Dockerfile
ruthpark00's picture
modified for transformer permission
7f463a7
Raw
History Blame Contribute Delete
845 Bytes
# 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"]