From ee3c6eea4718d21078101bf624e8495a369c8161 Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Sun, 29 Dec 2024 13:54:15 +0800 Subject: [PATCH] feat(docker): add Docker Compose configuration for PostgreSQL service --- docker/compose.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docker/compose.yml diff --git a/docker/compose.yml b/docker/compose.yml new file mode 100644 index 0000000..f88a31d --- /dev/null +++ b/docker/compose.yml @@ -0,0 +1,23 @@ +volumes: + postgres: + driver: local + +services: + postgres: + image: docker.io/library/postgres:14 + container_name: postgres + restart: always + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=${POSTGRES_DB} + volumes: + - postgres:/var/lib/postgresql/data + ports: + - "5432:5432" + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ] + interval: 5s + timeout: 5s + retries: 5 + start_period: 5s