From 64a0aa5c60be015a8a7a19edfda006392b7981ee Mon Sep 17 00:00:00 2001 From: Artem Ervits Date: Thu, 21 Sep 2023 12:13:53 -0400 Subject: [PATCH] refactor and upgrade to PG 16 --- docker-compose-postgresql.yml | 82 +++++++---------------------------- docker-compose.yml | 10 ++--- postgresql/Dockerfile | 6 +-- 3 files changed, 23 insertions(+), 75 deletions(-) diff --git a/docker-compose-postgresql.yml b/docker-compose-postgresql.yml index 647ce6c..ebbcb7b 100644 --- a/docker-compose-postgresql.yml +++ b/docker-compose-postgresql.yml @@ -2,76 +2,10 @@ version: '3.9' services: - roach-0: - container_name: roach-0 - hostname: roach-0 - image: cockroachdb/cockroach:latest-v22.2 - command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-0:26257 --advertise-addr=roach-0:26257 --max-sql-memory=.25 --cache=.25 - environment: - - 'ALLOW_EMPTY_PASSWORD=yes' - - roach-1: - container_name: roach-1 - hostname: roach-1 - image: cockroachdb/cockroach:latest-v22.2 - command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-1:26257 --advertise-addr=roach-1:26257 --max-sql-memory=.25 --cache=.25 - environment: - - 'ALLOW_EMPTY_PASSWORD=yes' - - roach-2: - container_name: roach-2 - hostname: roach-2 - image: cockroachdb/cockroach:latest-v22.2 - command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-2:26257 --advertise-addr=roach-2:26257 --max-sql-memory=.25 --cache=.25 - environment: - - 'ALLOW_EMPTY_PASSWORD=yes' - - init: - container_name: init - image: cockroachdb/cockroach:latest-v22.2 - command: init --host=roach-0 --insecure - depends_on: - - roach-0 - - lb: - container_name: lb - hostname: lb - build: haproxy - ports: - - "26257:26257" - - "8080:8080" - - "8081:8081" - depends_on: - - roach-0 - - roach-1 - - roach-2 - - client: - container_name: client - image: cockroachdb/cockroach:latest-v22.2 - entrypoint: ["/usr/bin/tail", "-f", "/dev/null"] - hostname: client - depends_on: - - lb - - postgresql: - container_name: postgresql - hostname: postgresql - build: postgresql/. - entrypoint: ["/usr/bin/tail", "-f", "/dev/null"] - environment: - - PGHOST=lb - - PGUSER=root - - PGPORT=26000 - - PGDATABASE=example - - SCALE=10 - depends_on: - - lb - flyway: container_name: flyway hostname: flyway - image: flyway/flyway:9.15.2 + image: flyway/flyway entrypoint: ["flyway", "migrate"] volumes: - ./postgresql/flyway/sql:/flyway/sql @@ -84,3 +18,17 @@ services: start_period: 10s depends_on: - lb + + postgresql: + container_name: postgresql + hostname: postgresql + build: postgresql/. + entrypoint: ["/usr/bin/tail", "-f", "/dev/null"] + environment: + - PGHOST=lb + - PGUSER=root + - PGPORT=26000 + - PGDATABASE=example + - SCALE=10 + depends_on: + - lb \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 08dc4dd..0e9905f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: roach-0: container_name: roach-0 hostname: roach-0 - image: cockroachdb/cockroach:latest-v23.1 + image: us-docker.pkg.dev/cockroach-cloud-images/cockroachdb/cockroach:v23.2.0-alpha.00000000-3468-g7cef593cfe1 command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-0:26257 --advertise-addr=roach-0:26257 --max-sql-memory=.25 --cache=.25 environment: - 'ALLOW_EMPTY_PASSWORD=yes' @@ -13,7 +13,7 @@ services: roach-1: container_name: roach-1 hostname: roach-1 - image: cockroachdb/cockroach:latest-v23.1 + image: us-docker.pkg.dev/cockroach-cloud-images/cockroachdb/cockroach:v23.2.0-alpha.00000000-3468-g7cef593cfe1 command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-1:26257 --advertise-addr=roach-1:26257 --max-sql-memory=.25 --cache=.25 environment: - 'ALLOW_EMPTY_PASSWORD=yes' @@ -21,14 +21,14 @@ services: roach-2: container_name: roach-2 hostname: roach-2 - image: cockroachdb/cockroach:latest-v23.1 + image: us-docker.pkg.dev/cockroach-cloud-images/cockroachdb/cockroach:v23.2.0-alpha.00000000-3468-g7cef593cfe1 command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-2:26257 --advertise-addr=roach-2:26257 --max-sql-memory=.25 --cache=.25 environment: - 'ALLOW_EMPTY_PASSWORD=yes' init: container_name: init - image: cockroachdb/cockroach:latest-v23.1 + image: us-docker.pkg.dev/cockroach-cloud-images/cockroachdb/cockroach:v23.2.0-alpha.00000000-3468-g7cef593cfe1 command: init --host=roach-0 --insecure depends_on: - roach-0 @@ -49,5 +49,5 @@ services: client: container_name: client hostname: client - image: cockroachdb/cockroach:latest-v23.1 + image: us-docker.pkg.dev/cockroach-cloud-images/cockroachdb/cockroach:v23.2.0-alpha.00000000-3468-g7cef593cfe1 entrypoint: ["/usr/bin/tail", "-f", "/dev/null"] diff --git a/postgresql/Dockerfile b/postgresql/Dockerfile index 6ff72dc..2c934ea 100644 --- a/postgresql/Dockerfile +++ b/postgresql/Dockerfile @@ -1,9 +1,9 @@ -FROM postgres:15.1 +FROM postgres LABEL maintainer="artemervits at gmail dot com" -LABEL version="1.0" +LABEL version="1.1" LABEL description="postgresql container" -ENV REFRESHED_AT 2023_04_17 +ENV REFRESHED_AT 2023_09_21 COPY tpcb-original.sql . COPY tpcb-cockroach.sql .