LoremPizza commited on
Commit
979d57c
·
verified ·
1 Parent(s): 916e0c0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,24 +1,22 @@
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.10-slim-buster
3
 
 
 
 
4
  # Create a user with UID 1000 and set up permissions
5
  RUN groupadd -g 1000 appuser && \
6
  useradd -m -u 1000 -g appuser appuser
7
 
8
- # Set the working directory in the container to /app
9
- WORKDIR /app
10
-
11
  # Copy the current directory contents into the container at /app
12
  ADD . /app
13
 
14
- # Change ownership of /app to the appuser
15
- RUN chown -R appuser:appuser /app
16
-
17
- # Switch to the appuser
18
- USER appuser
19
 
20
- # Install required packages and Cloudflare Warp dependencies
21
- RUN apt-get update && apt-get install -y wget gnupg && \
 
22
  wget -qO - https://pkg.cloudflareclient.com/pubkey.gpg | apt-key add - && \
23
  echo 'deb http://pkg.cloudflareclient.com/ buster main' | tee /etc/apt/sources.list.d/cloudflare-client.list && \
24
  apt-get update && apt-get install -y cloudflare-warp
@@ -26,6 +24,9 @@ RUN apt-get update && apt-get install -y wget gnupg && \
26
  # Install any needed packages specified in requirements.txt
27
  RUN pip install --no-cache-dir -r requirements.txt
28
 
 
 
 
29
  # Add an entrypoint script to handle Warp daemon and your application
30
  COPY entrypoint.sh /entrypoint.sh
31
  RUN chmod +x /entrypoint.sh
 
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.10-slim-buster
3
 
4
+ # Set the working directory in the container to /app
5
+ WORKDIR /app
6
+
7
  # Create a user with UID 1000 and set up permissions
8
  RUN groupadd -g 1000 appuser && \
9
  useradd -m -u 1000 -g appuser appuser
10
 
 
 
 
11
  # Copy the current directory contents into the container at /app
12
  ADD . /app
13
 
14
+ # Install required packages and Cloudflare Warp dependencies as root
15
+ USER root
 
 
 
16
 
17
+ # Fix missing directories and ensure permissions are correct
18
+ RUN mkdir -p /var/lib/apt/lists/partial && \
19
+ apt-get update && apt-get install -y wget gnupg && \
20
  wget -qO - https://pkg.cloudflareclient.com/pubkey.gpg | apt-key add - && \
21
  echo 'deb http://pkg.cloudflareclient.com/ buster main' | tee /etc/apt/sources.list.d/cloudflare-client.list && \
22
  apt-get update && apt-get install -y cloudflare-warp
 
24
  # Install any needed packages specified in requirements.txt
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Switch to the appuser for the remaining operations
28
+ USER appuser
29
+
30
  # Add an entrypoint script to handle Warp daemon and your application
31
  COPY entrypoint.sh /entrypoint.sh
32
  RUN chmod +x /entrypoint.sh