-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
40 lines (40 loc) · 911 Bytes
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
version: '3.8'
services:
# Main DB
db:
env_file: .env
image: postgres:14.1-alpine
restart: always
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
- ${DB_PORT}:5432
volumes:
- db:/var/lib/postgresql/data
# Test database, no persistance
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:
- '${REDIS_PORT}:${REDIS_PORT}'
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes:
- cache:/data
volumes:
db:
driver: local
cache:
driver: local