File size: 696 Bytes
bc6a982
d8cad3b
53d7ebc
661f043
53d7ebc
 
661f043
2a13ba4
53d7ebc
 
 
 
70009f7
53d7ebc
 
 
 
bc6a982
75ebd2a
53d7ebc
 
9b6148a
53d7ebc
bc6a982
9b6148a
53d7ebc
2b7caa6
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
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"]