Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +6 -4
Dockerfile
CHANGED
@@ -37,8 +37,10 @@ COPY --from=builder /usr/local /usr/local
|
|
37 |
# Copy the rest of the backend files to the container
|
38 |
COPY ./ .
|
39 |
|
40 |
-
#
|
41 |
-
|
|
|
|
|
42 |
|
43 |
-
# Start Redis server and
|
44 |
-
CMD ["bash", "-c", "
|
|
|
37 |
# Copy the rest of the backend files to the container
|
38 |
COPY ./ .
|
39 |
|
40 |
+
# Initialize PostgreSQL data directory and set permissions
|
41 |
+
RUN mkdir -p /usr/local/pgsql/data \
|
42 |
+
&& chown -R postgres:postgres /usr/local/pgsql/data \
|
43 |
+
&& su -c "/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data" postgres
|
44 |
|
45 |
+
# Start Redis server and PostgreSQL
|
46 |
+
CMD ["bash", "-c", "redis-server --daemonize yes && su -c '/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data -l logfile' postgres && uvicorn app:app --host 0.0.0.0 --port 7860"]
|