suhail commited on
Commit
200c0e9
·
1 Parent(s): 9eafd9f

docker update

Browse files
Files changed (1) hide show
  1. Dockerfile +54 -7
Dockerfile CHANGED
@@ -1,26 +1,73 @@
1
- # Use Python 3.11 slim 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
  gcc \
 
10
  postgresql-client \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copy requirements first for better caching
 
 
14
  COPY requirements.txt .
15
 
16
- # Install Python dependencies
 
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy application code
20
- COPY . .
 
 
 
 
 
 
 
21
 
22
- # Expose port 7860 (Hugging Face Spaces default)
 
 
23
  EXPOSE 7860
24
 
25
- # Run database migrations and start the application
 
 
26
  CMD alembic upgrade head && uvicorn src.main:app --host 0.0.0.0 --port 7860
 
1
+ # # Use Python 3.11 slim 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
+ # gcc \
10
+ # postgresql-client \
11
+ # && rm -rf /var/lib/apt/lists/*
12
+
13
+ # # Copy requirements first for better caching
14
+ # COPY requirements.txt .
15
+
16
+ # # Install Python dependencies
17
+ # RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # # Copy application code
20
+ # COPY . .
21
+
22
+ # # Expose port 7860 (Hugging Face Spaces default)
23
+ # EXPOSE 7860
24
+
25
+ # # Run database migrations and start the application
26
+ # CMD alembic upgrade head && uvicorn src.main:app --host 0.0.0.0 --port 7860
27
+
28
+
29
+ # =========================
30
+ # Base Image
31
+ # =========================
32
  FROM python:3.11-slim
33
 
34
  # Set working directory
35
  WORKDIR /app
36
 
37
+ # =========================
38
  # Install system dependencies
39
+ # =========================
40
  RUN apt-get update && apt-get install -y \
41
  gcc \
42
+ libpq-dev \
43
  postgresql-client \
44
  && rm -rf /var/lib/apt/lists/*
45
 
46
+ # =========================
47
+ # Copy requirements first (cache optimization)
48
+ # =========================
49
  COPY requirements.txt .
50
 
51
+ # Upgrade pip and install Python dependencies
52
+ RUN pip install --upgrade pip
53
  RUN pip install --no-cache-dir -r requirements.txt
54
 
55
+ # =========================
56
+ # Copy app source code
57
+ # =========================
58
+ COPY src/ ./src
59
+
60
+ # =========================
61
+ # Copy specs folder to match expected absolute path
62
+ # =========================
63
+ COPY specs/ /specs/
64
 
65
+ # =========================
66
+ # Expose port (for FastAPI / Hugging Face Spaces)
67
+ # =========================
68
  EXPOSE 7860
69
 
70
+ # =========================
71
+ # Run migrations and start app
72
+ # =========================
73
  CMD alembic upgrade head && uvicorn src.main:app --host 0.0.0.0 --port 7860