Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
@@ -22,6 +22,12 @@ RUN apt-get update \
|
|
22 |
&& apt-get clean \
|
23 |
&& rm -rf /var/lib/apt/lists/*
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
# Copy the built virtual environment from the builder stage
|
26 |
COPY --from=builder /usr/local /usr/local
|
27 |
|
@@ -31,5 +37,5 @@ COPY ./ .
|
|
31 |
# Expose the backend port (change this if your FastAPI app uses a different port)
|
32 |
EXPOSE 7860
|
33 |
|
34 |
-
# Start Redis server and the FastAPI app using Uvicorn
|
35 |
-
CMD ["bash", "-c", "redis-server --daemonize yes && uvicorn app:app --host 0.0.0.0 --port 7860"]
|
|
|
22 |
&& apt-get clean \
|
23 |
&& rm -rf /var/lib/apt/lists/*
|
24 |
|
25 |
+
# Install PostgreSQL client
|
26 |
+
RUN apt-get update \
|
27 |
+
&& apt-get install -y --no-install-recommends postgresql-client \
|
28 |
+
&& apt-get clean \
|
29 |
+
&& rm -rf /var/lib/apt/lists/*
|
30 |
+
|
31 |
# Copy the built virtual environment from the builder stage
|
32 |
COPY --from=builder /usr/local /usr/local
|
33 |
|
|
|
37 |
# Expose the backend port (change this if your FastAPI app uses a different port)
|
38 |
EXPOSE 7860
|
39 |
|
40 |
+
# Start Redis server, PostgreSQL server, and the FastAPI app using Uvicorn
|
41 |
+
CMD ["bash", "-c", "service postgresql start && redis-server --daemonize yes && uvicorn app:app --host 0.0.0.0 --port 7860"]
|