Files
database-gateway/example/docker-compose.yaml
2025-04-15 23:25:49 +02:00

70 lines
2.0 KiB
YAML

# Database Gateway provides access to servers with ACL for safe and restricted database interactions.
# Copyright (C) 2024 Kirill Zhuravlev
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
services:
dbgw:
image: kazhuravlev/database-gateway:latest
pull_policy: always
restart: on-failure
depends_on:
- "storage-postgres"
ports:
- '127.0.0.1:8080:8080'
volumes:
- './config.json:/app/config.json'
command:
- "run"
storage-postgres:
image: postgres:16
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "local__dbgw" ]
interval: 10s
timeout: 3s
retries: 5
start_period: 5s
environment:
POSTGRES_DB: local__dbgw
POSTGRES_USER: local__dbgw
POSTGRES_PASSWORD: local__dbgw
postgres1:
image: postgres:16
environment:
POSTGRES_DB: pg01
POSTGRES_USER: pg01
POSTGRES_PASSWORD: pg01
volumes:
- './init-01.sql:/docker-entrypoint-initdb.d/init.sql'
postgres2:
image: postgres:16
environment:
POSTGRES_DB: pg02
POSTGRES_USER: pg02
POSTGRES_PASSWORD: pg02
volumes:
- './init-02.sql:/docker-entrypoint-initdb.d/init.sql'
postgres3:
image: postgres:16
environment:
POSTGRES_DB: pg03
POSTGRES_USER: pg03
POSTGRES_PASSWORD: pg03
volumes:
- './init-03.sql:/docker-entrypoint-initdb.d/init.sql'