Spaces:
No application file
No application file
push updated backend changes
Browse files- Dockerfiile +7 -20
Dockerfiile
CHANGED
@@ -1,31 +1,18 @@
|
|
1 |
-
# Base image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
-
# Set working directory
|
9 |
WORKDIR /app
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
build-essential \
|
14 |
-
git \
|
15 |
-
&& rm -rf /var/lib/apt/lists/*
|
16 |
-
|
17 |
-
# Copy dependency file first (better caching)
|
18 |
-
COPY requirements.txt /app/
|
19 |
|
20 |
-
# Install
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
-
#
|
24 |
-
COPY . /app
|
25 |
-
|
26 |
-
# Expose port for FastAPI
|
27 |
EXPOSE 7860
|
28 |
|
29 |
-
#
|
30 |
-
# (replace main:app with the actual filename:FastAPI instance)
|
31 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# Install dependencies
|
4 |
+
RUN apt-get update && apt-get install -y git
|
|
|
5 |
|
|
|
6 |
WORKDIR /app
|
7 |
|
8 |
+
# Copy code
|
9 |
+
COPY . /app
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
# Install Python deps
|
12 |
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
|
14 |
+
# Expose port
|
|
|
|
|
|
|
15 |
EXPOSE 7860
|
16 |
|
17 |
+
# Run FastAPI app
|
|
|
18 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|