irongit

Django + Next + Postgres + Docker + Nginx

djext/docker-entrypoint.sh
16 lines499 BBourne Again Shell (bash)
1#!/bin/bash
2
3# postgres stuff
4chown postgres:postgres /var/lib/postgresql/data
5if [ ! "$(ls -A /var/lib/postgresql/data)" ]; then
6 su postgres -c "initdb -D /var/lib/postgresql/data"
7fi
8sed -i 's/\/run\/postgresql/\/tmp/' /var/lib/postgresql/data/postgresql.conf
9su postgres -c 'pg_ctl start -D /var/lib/postgresql/data'
10
11nginx
12tail -f /var/lib/nginx/logs/access.log &
13
14cd frontend && npm start &
15cd backend && python manage.py migrate
16cd /backend && uvicorn backend.asgi:application --host 0.0.0.0