From 5816baea13ce117b753d716b3035b1f221e88fc3 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sun, 27 Oct 2019 23:43:09 +0300 Subject: [PATCH] Adding common Postgres stack. --- postgres-common/.env.dist | 2 ++ postgres-common/docker-compose.yml | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 postgres-common/.env.dist create mode 100644 postgres-common/docker-compose.yml diff --git a/postgres-common/.env.dist b/postgres-common/.env.dist new file mode 100644 index 0000000..424f7f6 --- /dev/null +++ b/postgres-common/.env.dist @@ -0,0 +1,2 @@ +POSTGRES_PASSWORD=password +COMMON_DATABASE_NETWORK=database-net diff --git a/postgres-common/docker-compose.yml b/postgres-common/docker-compose.yml new file mode 100644 index 0000000..40c9105 --- /dev/null +++ b/postgres-common/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.7' + +services: + postgres-common: + image: postgres:12-alpine + container_name: postgres-common + env_file: .env + networks: + - db-network + ports: + - "127.0.0.1:5432:5432/tcp" + volumes: + # Database files + - postgres-data:/var/lib/postgresql/data + restart: unless-stopped + +volumes: + postgres-data: + +networks: + db-network: + name: "${COMMON_DATABASE_NETWORK:-database-network}" + external: true