diff --git a/docker/README.md b/docker/README.md index c73b24feb..61ed3bb94 100644 --- a/docker/README.md +++ b/docker/README.md @@ -135,7 +135,7 @@ The Trino Gateway is available at [http://localhost:8080](http://localhost:8080) The PostgreSQL backend database for Trino Gateway runs on `localhost:5432`. You can query it for troubleshooting and other purposes using the credentials and -details found in the `postgres-backend-compose.yml` file. +details found in the `docker-compose.yml` file. ## Configuration diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6b52887da..0fe3d7552 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,20 +1,39 @@ version: "3.4" services: trino-gateway: - extends: - file: ./trino-gateway-compose.yml - service: trino-gateway + image: ${TRINO_GATEWAY_IMAGE:-trinodb/trino-gateway:latest} + depends_on: + postgres: + condition: service_healthy healthcheck: interval: 5s timeout: 5s retries: 60 start_period: 20s + ports: + - "8080:8080" + volumes: + - target: /opt/trino/gateway-ha-config.yml + source: ../gateway-ha/gateway-ha-config-docker.yml + type: bind + postgres: - extends: - file: ./postgres-backend-compose.yml - service: postgres + image: ${TRINO_GATEWAY_POSTGRES_IMAGE:-postgres} + environment: + - PGPORT=5432 + - POSTGRES_PASSWORD=P0stG&es + - POSTGRES_DB=trino_gateway_db + - POSTGRES_USER=trino_gateway_db_admin + ports: + - "5432:5432" healthcheck: + # Need user and database name to check PostgreSQL server status + test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB || exit 1"] interval: 1s timeout: 1s retries: 60 start_period: 10s + volumes: + - target: /docker-entrypoint-initdb.d/1-gateway-ha-persistence-postgres.sql + source: ../gateway-ha/src/main/resources/gateway-ha-persistence-postgres.sql + type: bind diff --git a/docker/postgres-backend-compose.yml b/docker/postgres-backend-compose.yml deleted file mode 100644 index 68ae3bb01..000000000 --- a/docker/postgres-backend-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: "3.4" -services: - postgres: - image: ${TRINO_GATEWAY_POSTGRES_IMAGE:-postgres} - environment: - - PGPORT=5432 - - POSTGRES_PASSWORD=P0stG&es - - POSTGRES_DB=trino_gateway_db - - POSTGRES_USER=trino_gateway_db_admin - ports: - - "5432:5432" - healthcheck: - # Need user and database name to check PostgreSQL server status - test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB || exit 1"] - interval: 10s - timeout: 3s - retries: 10 - volumes: - - target: /docker-entrypoint-initdb.d/1-gateway-ha-persistence-postgres.sql - source: ../gateway-ha/src/main/resources/gateway-ha-persistence-postgres.sql - type: bind diff --git a/docker/trino-gateway-compose.yml b/docker/trino-gateway-compose.yml deleted file mode 100644 index 9869ca06d..000000000 --- a/docker/trino-gateway-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: "3.4" -services: - trino-gateway: - image: ${TRINO_GATEWAY_IMAGE:-trinodb/trino-gateway:latest} - depends_on: - postgres: - condition: service_healthy - healthcheck: - interval: 10s - timeout: 5s - retries: 3 - start_period: 10s - ports: - - "8080:8080" - volumes: - - target: /opt/trino/gateway-ha-config.yml - source: ../gateway-ha/gateway-ha-config-docker.yml - type: bind - # - target: /opt/trino/localhost.jks - # source: ../gateway-ha/target/localhost.jks - # type: bind