Rolaficus commited on
Commit
a338890
·
verified ·
1 Parent(s): 94b5e54

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -17
Dockerfile CHANGED
@@ -1,33 +1,22 @@
1
- # Use full Python 3.10 (Debian based, includes all standard libs)
2
  FROM python:3.10
3
 
4
- # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1
7
 
8
- # Set working directory
9
  WORKDIR /code
10
 
11
- # Install specific networking tools for debugging (optional but helpful)
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
- dnsutils \
14
- iputils-ping \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
- # Create user
18
- RUN useradd -m -u 1000 user
19
-
20
- # Copy and install requirements
21
  COPY ./requirements.txt /code/requirements.txt
22
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
23
 
24
- # Copy application files with ownership
25
- COPY --chown=user . /code
26
-
27
- # Switch user
28
- USER user
29
- ENV HOME=/home/user \
30
- PATH=/home/user/.local/bin:$PATH
31
 
32
  # Run app
33
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use full Python 3.10
2
  FROM python:3.10
3
 
 
4
  ENV PYTHONDONTWRITEBYTECODE=1 \
5
  PYTHONUNBUFFERED=1
6
 
 
7
  WORKDIR /code
8
 
9
+ # Install certificates and request tools
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ ca-certificates \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Install requirements
 
 
 
15
  COPY ./requirements.txt /code/requirements.txt
16
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
17
 
18
+ # Copy app (No chown needed, let default permissions apply)
19
+ COPY . .
 
 
 
 
 
20
 
21
  # Run app
22
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]