HFswapnil commited on
Commit
f3f3951
·
verified ·
1 Parent(s): 4bf10a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -39
Dockerfile CHANGED
@@ -1,39 +1,44 @@
1
- ## Use official python 3.12 image
2
- FROM python:3.9
3
-
4
-
5
- ## Set working directory to /code
6
- WORKDIR /code
7
-
8
-
9
- ## Copy the current directory content in the container at /code
10
- COPY ./requirements.txt /code/requirements.txt
11
-
12
-
13
- ## Install the requirements.txt
14
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
15
-
16
-
17
-
18
- ## Setup new user named "user"
19
- RUN useradd user
20
-
21
-
22
- ## Switch to the "user" user
23
- USER user
24
-
25
-
26
- ENV HOME=/home/user \
27
- PATH=/home/user/.local/bin:$PATH
28
-
29
-
30
- WORKDIR $HOME/app
31
-
32
- COPY --chown=user . $HOME/app
33
-
34
-
35
- ## Start the FastAPI App on port 7860
36
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
37
-
38
-
39
-
 
 
 
 
 
 
1
+ ## Use official python 3.12 image
2
+ FROM python:3.9
3
+
4
+
5
+ ## Set working directory to /code
6
+ WORKDIR /code
7
+
8
+
9
+ ## Copy the current directory content in the container at /code
10
+ COPY ./requirements.txt /code/requirements.txt
11
+
12
+
13
+ RUN apt-get update && \
14
+ apt-get install -y build-essential && \
15
+ rm -rf /var/lib/apt/lists/*
16
+
17
+
18
+ ## Install the requirements.txt
19
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
20
+
21
+
22
+
23
+ ## Setup new user named "user"
24
+ RUN useradd user
25
+
26
+
27
+ ## Switch to the "user" user
28
+ USER user
29
+
30
+
31
+ ENV HOME=/home/user \
32
+ PATH=/home/user/.local/bin:$PATH
33
+
34
+
35
+ WORKDIR $HOME/app
36
+
37
+ COPY --chown=user . $HOME/app
38
+
39
+
40
+ ## Start the FastAPI App on port 7860
41
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
42
+
43
+
44
+