aryanwinningson commited on
Commit
bf34735
·
verified ·
1 Parent(s): 9781fcd

added system dependencies

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -22
Dockerfile CHANGED
@@ -1,22 +1,30 @@
1
- FROM python:3.11.4
2
-
3
- # Create a non-root user with a fixed UID
4
- RUN useradd -m -u 1000 user
5
-
6
- WORKDIR /app
7
-
8
- # Copy and install dependencies
9
- COPY --chown=user ./requirements.txt requirements.txt
10
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
-
12
- # Copy the rest of the application code
13
- COPY --chown=user . /app
14
-
15
- # Switch to non-root user
16
- USER user
17
-
18
- # Expose the port that the app will run on
19
- EXPOSE 7860
20
-
21
- # Start the application
22
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11.4
2
+
3
+ # Create a non-root user with a fixed UID
4
+ RUN useradd -m -u 1000 user
5
+
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ libgl1-mesa-glx \
9
+ libglib2.0-0 \
10
+ && apt-get clean \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+
14
+ WORKDIR /app
15
+
16
+ # Copy and install dependencies
17
+ COPY --chown=user ./requirements.txt requirements.txt
18
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
+
20
+ # Copy the rest of the application code
21
+ COPY --chown=user . /app
22
+
23
+ # Switch to non-root user
24
+ USER user
25
+
26
+ # Expose the port that the app will run on
27
+ EXPOSE 7860
28
+
29
+ # Start the application
30
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]