ashwinR commited on
Commit
1b04fe3
·
1 Parent(s): 6f0319c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -1
Dockerfile CHANGED
@@ -41,7 +41,14 @@ COPY --from=builder /usr/local /usr/local
41
  COPY ./ .
42
 
43
  # Start Redis server and PostgreSQL in the background
44
- RUN service redis-server start && /usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data -l logfile &
 
 
 
 
 
 
 
45
 
46
  # Install additional Python dependencies
47
  #RUN pip install -U -q pyngrok ipython psycopg2 alembic
 
41
  COPY ./ .
42
 
43
  # Start Redis server and PostgreSQL in the background
44
+ RUN service redis-server start \
45
+ && service postgresql start \
46
+ && su -u postgres psql -c "CREATE USER postadmin WITH PASSWORD 'postpass';" \
47
+ && su -u postgres psql -c "CREATE DATABASE siksalaya;" \
48
+ && su -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE sikshyalaya TO postadmin;"
49
+
50
+ # Switch back to a non-root user for security
51
+ USER appuser
52
 
53
  # Install additional Python dependencies
54
  #RUN pip install -U -q pyngrok ipython psycopg2 alembic