File size: 708 Bytes
db29447
 
3a0658b
db29447
 
3a0658b
db29447
 
 
3a0658b
 
 
fbe7328
db29447
3a0658b
db29447
 
3a0658b
db29447
 
3a0658b
db29447
3a0658b
db29447
3a0658b
db29447
 
3a0658b
db29447
 
3a0658b
 
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
32
33
FROM python:3.10.12

# Set the working directory
WORKDIR /code

# Copy and install requirements
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Install additional system packages
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git



# Add a new user
RUN useradd -m -u 1000 user

# Switch to the new user
USER user

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

# Create application directory and set as working directory
WORKDIR $HOME/app

# Copy application code and set ownership
COPY --chown=user . $HOME/app

# Set the command to run the application
CMD ["python", "main.py"]