File size: 724 Bytes
508f4e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10.9

# Create user with home directory
RUN useradd -m -u 1000 user

# Switch to the created user
USER user

# Set environment variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    TRANSFORMERS_CACHE=/home/user/.cache

# Create necessary directories with the right permissions
RUN mkdir -p $HOME/.cache && chmod -R 777 $HOME/.cache

# Set the working directory
WORKDIR $HOME/Redaction

# Copy project files to the working directory
COPY --chown=user . $HOME/Redaction

# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Set the command to run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]