heisbuba commited on
Commit
41dc236
·
verified ·
1 Parent(s): 13588f7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -1,20 +1,20 @@
1
  # Use the official Python image
2
- FROM python:3.10-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # 1. Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  wget \
10
  gnupg \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # 2. Install Python dependencies
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # 3. CONFIGURE PLAYWRIGHT (The Critical Fix)
18
  # Set a global path for browsers so both Root (builder) and User (runner) can find them
19
  ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
20
  RUN mkdir -p $PLAYWRIGHT_BROWSERS_PATH
@@ -23,10 +23,10 @@ RUN mkdir -p $PLAYWRIGHT_BROWSERS_PATH
23
  RUN playwright install-deps chromium
24
  RUN playwright install chromium
25
 
26
- # 4. Copy Application Code
27
  COPY . .
28
 
29
- # 5. Create and Switch to Non-Root User
30
  RUN useradd -m -u 1000 user
31
 
32
  # Ensure the user has permissions to access the browsers
 
1
  # Use the official Python image
2
+ FROM python:3.11-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  wget \
10
  gnupg \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Install Python dependencies
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # CONFIGURE PLAYWRIGHT
18
  # Set a global path for browsers so both Root (builder) and User (runner) can find them
19
  ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
20
  RUN mkdir -p $PLAYWRIGHT_BROWSERS_PATH
 
23
  RUN playwright install-deps chromium
24
  RUN playwright install chromium
25
 
26
+ # Copy Application Code
27
  COPY . .
28
 
29
+ # Create and Switch to Non-Root User
30
  RUN useradd -m -u 1000 user
31
 
32
  # Ensure the user has permissions to access the browsers