File size: 803 Bytes
82bc3c8
 
 
4e05993
 
 
 
82bc3c8
 
 
 
522b706
 
 
 
 
 
82bc3c8
 
 
 
 
 
 
dc568c3
82bc3c8
2bcb686
99164d8
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
# 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"]