suhail commited on
Commit
c1648a3
·
1 Parent(s): 59e01fd

dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +66 -15
Dockerfile CHANGED
@@ -26,16 +26,70 @@
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 \
@@ -44,35 +98,32 @@ RUN apt-get update && apt-get install -y \
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 alembic config
62
  COPY alembic.ini .
63
 
64
-
65
  # =========================
66
- # Copy specs folder to match expected absolute path
67
  # =========================
68
  COPY specs/ /specs/
69
 
70
  # =========================
71
- # Expose port (for FastAPI / Hugging Face Spaces)
72
  # =========================
73
  EXPOSE 7860
74
 
75
  # =========================
76
- # Run migrations and start app
77
  # =========================
78
  CMD alembic upgrade head && uvicorn src.main:app --host 0.0.0.0 --port 7860
 
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 alembic config
62
+ # COPY alembic.ini .
63
+
64
+ # # =========================
65
+ # # Copy specs folder to match expected absolute path
66
+ # # =========================
67
+ # COPY specs/ /specs/
68
+
69
+ # # =========================
70
+ # # Expose port (for FastAPI / Hugging Face Spaces)
71
+ # # =========================
72
+ # EXPOSE 7860
73
+
74
+ # # =========================
75
+ # # Run migrations and start app
76
+ # # =========================
77
+ # CMD alembic upgrade head && uvicorn src.main:app --host 0.0.0.0 --port 7860
78
+
79
+
80
+ # ////////////////////
81
+
82
+
83
+
84
  FROM python:3.11-slim
85
 
86
+ # =========================
87
+ # Working directory
88
+ # =========================
89
  WORKDIR /app
90
 
91
  # =========================
92
+ # System dependencies
93
  # =========================
94
  RUN apt-get update && apt-get install -y \
95
  gcc \
 
98
  && rm -rf /var/lib/apt/lists/*
99
 
100
  # =========================
101
+ # Python dependencies
102
  # =========================
103
  COPY requirements.txt .
 
 
104
  RUN pip install --upgrade pip
105
  RUN pip install --no-cache-dir -r requirements.txt
106
 
107
  # =========================
108
+ # Copy application code
109
  # =========================
110
  COPY src/ ./src
111
 
112
+ # ✅ COPY ALEMBIC (THIS WAS MISSING)
113
+ COPY alembic/ ./alembic/
114
  COPY alembic.ini .
115
 
 
116
  # =========================
117
+ # Optional: specs folder
118
  # =========================
119
  COPY specs/ /specs/
120
 
121
  # =========================
122
+ # Expose port (HF Spaces)
123
  # =========================
124
  EXPOSE 7860
125
 
126
  # =========================
127
+ # Run migrations then app
128
  # =========================
129
  CMD alembic upgrade head && uvicorn src.main:app --host 0.0.0.0 --port 7860