From d1e59c4219815e8e61ae4c5b86aa729bb8ae8dc0 Mon Sep 17 00:00:00 2001 From: Dejan Zdravkovic Date: Sun, 22 Dec 2024 19:25:04 +0100 Subject: [PATCH] docker-compose-db --- backend/spring-boot/docker-compose-db.yml | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 backend/spring-boot/docker-compose-db.yml diff --git a/backend/spring-boot/docker-compose-db.yml b/backend/spring-boot/docker-compose-db.yml new file mode 100644 index 00000000..0add310c --- /dev/null +++ b/backend/spring-boot/docker-compose-db.yml @@ -0,0 +1,50 @@ +services: + postgres: + container_name: postgres + image: postgres:17.2-alpine + ports: + - "${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}" + environment: + PGPORT: ${POSTGRES_PORT:-5432} + POSTGRES_DB: ${POSTGRES_DATABASE:-bootstrapbugz} + POSTGRES_USER: ${POSTGRES_USERNAME:-postgres} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-root} + healthcheck: + test: + [ + "CMD", + "pg_isready", + "-U", + "${POSTGRES_USERNAME:-postgres}", + "-d", + "${POSTGRES_DATABASE:-bootstrapbugz}", + ] + start_period: 10s + interval: 30s + retries: 3 + + redis: + container_name: redis + image: redis:7.4.1 + ports: + - "${REDIS_PORT:-6379}:${REDIS_PORT:-6379}" + command: redis-server --port ${REDIS_PORT:-6379} --requirepass ${REDIS_PASSWORD:-root} + environment: + REDIS_DATABASE: ${REDIS_DATABASE:-0} + REDIS_PASSWORD: ${REDIS_PASSWORD:-root} + healthcheck: + test: + [ + "CMD", + "redis-cli", + "-h", + "localhost", + "-p", + "${REDIS_PORT:-6379}", + "-a", + "${REDIS_PASSWORD:-root}", + "ping", + ] + start_period: 10s + interval: 30s + retries: 3