Rolaficus commited on
Commit
5297539
·
verified ·
1 Parent(s): d200706

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -15
Dockerfile CHANGED
@@ -1,29 +1,15 @@
1
- # Use standard Python 3.9
2
  FROM python:3.9
3
-
4
- # 1. Setup Environment
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1 \
7
  HOME=/home/user \
8
  PATH=/home/user/.local/bin:$PATH
9
-
10
- # 2. Create the "user" (UID 1000) required by Hugging Face
11
  RUN useradd -m -u 1000 user
12
-
13
- # 3. Set working directory and ownership
14
  WORKDIR /app
15
  RUN chown user:user /app
16
-
17
- # 4. Switch to the user for all subsequent commands
18
  USER user
19
-
20
- # 5. Copy requirements and install
21
  COPY --chown=user:user requirements.txt requirements.txt
22
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
-
24
- # 6. Copy the rest of the app
25
  COPY --chown=user:user . .
26
 
27
- # 7. Run the application
28
- # We use app:app because the file is named app.py
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9
 
 
2
  ENV PYTHONDONTWRITEBYTECODE=1 \
3
  PYTHONUNBUFFERED=1 \
4
  HOME=/home/user \
5
  PATH=/home/user/.local/bin:$PATH
 
 
6
  RUN useradd -m -u 1000 user
 
 
7
  WORKDIR /app
8
  RUN chown user:user /app
 
 
9
  USER user
 
 
10
  COPY --chown=user:user requirements.txt requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
12
  COPY --chown=user:user . .
13
 
14
+ EXPOSE 7860
 
15
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]