ojaskittur commited on
Commit
ad7b872
·
1 Parent(s): 832a62a

Fix shell syntax error in Dockerfile

Browse files
Files changed (2) hide show
  1. .dockerignore +5 -0
  2. Dockerfile +4 -7
.dockerignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ venv/
2
+ __pycache__/
3
+ .git/
4
+ .DS_Store
5
+ *.pyc
Dockerfile CHANGED
@@ -1,12 +1,9 @@
1
- # Use specific bookworm tag to ensure stability, or stick to slim
2
- # We will use the generic slim but fix the Java install
3
  FROM python:3.11-slim
4
 
5
  WORKDIR /app
6
 
7
  # 1. Install System Dependencies
8
- # Changed 'openjdk-17-jdk-headless' to 'default-jdk-headless'
9
- # This automatically picks the correct available Java version (likely 21)
10
  RUN apt-get update && \
11
  apt-get install -y default-jdk-headless build-essential git && \
12
  rm -rf /var/lib/apt/lists/*
@@ -15,12 +12,12 @@ RUN apt-get update && \
15
  COPY . .
16
 
17
  # 3. Install Python libraries
18
- # --upgrade pip first to avoid wheel build issues
19
  RUN pip install --no-cache-dir --upgrade pip && \
20
  pip install --no-cache-dir -r requirements.txt
21
 
22
- # 4. Create User (Robust Check)
23
- RUN id -u user &>/dev/null || useradd -m -u 1000 user
 
24
 
25
  # 5. Fix Permissions
26
  RUN chown -R user:user /app && \
 
 
 
1
  FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
  # 1. Install System Dependencies
6
+ # default-jdk-headless ensures we get a compatible Java version (likely 17 or 21)
 
7
  RUN apt-get update && \
8
  apt-get install -y default-jdk-headless build-essential git && \
9
  rm -rf /var/lib/apt/lists/*
 
12
  COPY . .
13
 
14
  # 3. Install Python libraries
 
15
  RUN pip install --no-cache-dir --upgrade pip && \
16
  pip install --no-cache-dir -r requirements.txt
17
 
18
+ # 4. Create User (Fixed for 'dash' shell)
19
+ # Changed '&>/dev/null' to '>/dev/null 2>&1' to match the system shell
20
+ RUN id -u user >/dev/null 2>&1 || useradd -m -u 1000 user
21
 
22
  # 5. Fix Permissions
23
  RUN chown -R user:user /app && \