Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
test: add dedicated tested db
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrisnl committed Feb 5, 2024
1 parent 39e9bef commit e086fab
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
version: '3.8'
services:
# Main DB
db:
env_file: .env
image: postgres:14.1-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
- '5432:5432'
- ${DB_PORT}:5432
volumes:
- db:/var/lib/postgresql/data
# Test database, no persistance
# db-test:
# image: postgres
# environment:
# - POSTGRES_USER=test-postgres
# - POSTGRES_PASSWORD=test-postgres
# ports:
# - ${POSTGRES_TEST_PORT}:5432
db-test:
env_file: .env
image: postgres:14.1-alpine
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${TEST_DB_NAME}
ports:
- ${TEST_DB_PORT}:5432
# Main Redis cache
cache:
env_file: .env
image: redis:6.2-alpine
restart: always
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
- '${REDIS_PORT}:${REDIS_PORT}'
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes:
- cache:/data
volumes:
Expand Down

0 comments on commit e086fab

Please sign in to comment.