StefanG2002 commited on
Commit
ca017d0
·
verified ·
1 Parent(s): 174fffd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Create a new group and user
4
+ RUN groupadd -g 1000 StefanG2002 && \
5
+ useradd -m -u 1000 -g StefanG2002 StefanG2002
6
+
7
+ # Set ownership and permissions for the home directory
8
+ RUN chown -R StefanG2002:StefanG2002 /home/StefanG2002 && \
9
+ chmod -R 755 /home/StefanG2002
10
+
11
+ # Switch to the newly created user
12
+ USER StefanG2002
13
+
14
+ # Set environment variables
15
+ ENV HOME=/home/StefanG2002 \
16
+ PATH=/home/StefanG2002/.local/bin:$PATH
17
+
18
+ WORKDIR /code
19
+
20
+ COPY ./requirements.txt /code/requirements.txt
21
+
22
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
23
+
24
+ COPY . .
25
+
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]