47 lines
1.0 KiB
YAML
47 lines
1.0 KiB
YAML
version: '3.8'
|
|
services:
|
|
db:
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_USER: admin
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_DB: sop_monitoring
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- ./db:/docker-entrypoint-initdb.d
|
|
- pgdata:/var/lib/postgresql/data
|
|
command: >
|
|
bash -c "
|
|
if [ -f /var/lib/postgresql/data/pg_hba.conf ]; then
|
|
sed -i 's/hostssl/host/g' /var/lib/postgresql/data/pg_hba.conf
|
|
echo 'host all all all md5' >> /var/lib/postgresql/data/pg_hba.conf
|
|
echo 'host all all all scram-sha-256' >> /var/lib/postgresql/data/pg_hba.conf
|
|
fi
|
|
exec docker-entrypoint.sh postgres
|
|
"
|
|
|
|
api:
|
|
build: ./api
|
|
environment:
|
|
- DB_HOST=db
|
|
- DB_USER=admin
|
|
- DB_PASS=password
|
|
- DB_NAME=sop_monitoring
|
|
- DB_PORT=5432
|
|
- PORT=3000
|
|
depends_on:
|
|
- db
|
|
restart: always
|
|
|
|
ui:
|
|
build: ./ui
|
|
expose:
|
|
- "80"
|
|
depends_on:
|
|
- api
|
|
restart: always
|
|
|
|
volumes:
|
|
pgdata:
|