rairo commited on
Commit
f209ec0
·
verified ·
1 Parent(s): 9b92981

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ # FIXED: Added ffmpeg and other required libraries to the existing system dependency installation.
4
+ # This is the only line that has been changed.
5
+ RUN apt-get update && apt-get install -y libgl1-mesa-glx ffmpeg libsm6 libxext6
6
+
7
+ ### Set up user with permissions
8
+ # Set up a new user named "user" with user ID 1000
9
+ RUN useradd -m -u 1000 user
10
+
11
+ # Switch to the "user" user
12
+ USER user
13
+
14
+ # Set home to the user's home directory
15
+ ENV HOME=/home/user \
16
+ PATH=/home/user/.local/bin:$PATH
17
+
18
+ # Set the working directory to the user's home directory
19
+ WORKDIR $HOME/app
20
+
21
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
22
+ COPY --chown=user . $HOME/app
23
+
24
+ ### Set up app-specific content
25
+ COPY requirements.txt requirements.txt
26
+ RUN pip3 install -r requirements.txt
27
+
28
+ COPY . .
29
+
30
+ ### Update permissions for the app
31
+ USER root
32
+ RUN chmod 777 ~/app/*
33
+ USER user
34
+
35
+ CMD ["python", "main.py"]