version: '3.8' services: db: image: postgres:15 environment: POSTGRES_USER: admin POSTGRES_PASSWORD: password POSTGRES_DB: sop_monitoring FORCE_RESTART: 1 ports: - "5432:5432" volumes: - ./db:/docker-entrypoint-initdb.d - pgdata:/var/lib/postgresql/data db_fixer: image: alpine restart: "no" volumes: - pgdata:/var/lib/postgresql/data command: > sh -c "sed -i 's/hostssl/host/g' /var/lib/postgresql/data/pg_hba.conf || true; sed -i 's/hostnossl/host/g' /var/lib/postgresql/data/pg_hba.conf || true; echo 'host all all all scram-sha-256' >> /var/lib/postgresql/data/pg_hba.conf; echo 'host all all all md5' >> /var/lib/postgresql/data/pg_hba.conf" 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: