ashwinR commited on
Commit
bc24947
1 Parent(s): 4e65373

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -19
Dockerfile CHANGED
@@ -16,25 +16,9 @@ FROM python:3.9-slim
16
 
17
  WORKDIR /app
18
 
19
- RUN apt update -y
20
- RUN apt install redis-server -y
21
- RUN redis-server --daemonize yes
22
- RUN redis-cli ping
23
-
24
- RUN apt-get install postgresql -y
25
- RUN service postgresql start
26
- RUN apt-get -y install postgresql
27
-
28
- RUN pip install -U -q pyngrok ipython psycopg2 alembic
29
-
30
- RUN sudo -u postgres psql -c "CREATE USER postadmin WITH PASSWORD 'postpass'";
31
- RUN sudo -u postgres psql -c "CREATE DATABASE siksalaya;"
32
- RUN sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE sikshyalaya TO postadmin;"
33
-
34
-
35
  # Install runtime dependencies
36
  RUN apt-get update \
37
- && apt-get install -y --no-install-recommends libpq5 \
38
  && apt-get clean \
39
  && rm -rf /var/lib/apt/lists/*
40
 
@@ -47,5 +31,5 @@ COPY ./ .
47
  # Expose the backend port (change this if your FastAPI app uses a different port)
48
  EXPOSE 7860
49
 
50
- # Start the FastAPI app using Uvicorn
51
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
16
 
17
  WORKDIR /app
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  # Install runtime dependencies
20
  RUN apt-get update \
21
+ && apt-get install -y --no-install-recommends libpq5 redis-server \
22
  && apt-get clean \
23
  && rm -rf /var/lib/apt/lists/*
24
 
 
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"]