AurelioAguirre commited on
Commit
ad51e60
·
1 Parent(s): 5d274cb

New Dockerfile, still dummy app

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -23
Dockerfile CHANGED
@@ -1,32 +1,23 @@
1
  FROM python:3.10-slim
2
 
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y \
5
- bash \
6
- wget \
7
- git \
8
- git-lfs \
9
- && rm -rf /var/lib/apt/lists/*
10
 
11
- # Set up user properly
12
- RUN useradd -m -u 1000 user
13
- ENV HOME=/home/user \
14
- PATH=/home/user/.local/bin:$PATH
15
 
16
- # Set working directory in user's home
17
- WORKDIR $HOME/app
18
 
19
- # Copy requirements and install as user
20
- COPY --chown=user requirements.txt .
21
- USER user
22
- RUN pip install --no-cache-dir --upgrade pip && \
23
- pip install --no-cache-dir -r requirements.txt
24
 
25
- # Copy application code
26
- COPY --chown=user . $HOME/app
 
27
 
28
- # Make sure port matches the one in your code
29
  EXPOSE 7680
30
 
31
- # Use uvicorn directly with specific settings
32
- CMD ["uvicorn", "main.app:app", "--host", "0.0.0.0", "--port", "7680", "--workers", "1"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Set working directory
4
+ WORKDIR /app
 
 
 
 
 
5
 
6
+ # Copy requirements first to leverage Docker cache
7
+ COPY requirements.txt .
 
 
8
 
9
+ # Install dependencies
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ # Copy only what's needed
13
+ COPY main/ ./main/
 
 
 
14
 
15
+ # Set environment variables
16
+ ENV PYTHONPATH=/app
17
+ ENV PYTHONUNBUFFERED=1
18
 
19
+ # Expose the port
20
  EXPOSE 7680
21
 
22
+ # Use same command as working version
23
+ CMD ["python", "-m", "main.app"]