-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
32 lines (29 loc) · 992 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
version: '3.8'
services:
db:
image: postgres:15.2-alpine
restart: always
ports:
- '${DB_PORT}:5432'
volumes:
- 'pgdata:/var/lib/postgresql/data'
- ./bin/create-multiple-postgresql-databases.sh:/docker-entrypoint-initdb.d/create-multiple-postgresql-databases.sh
# Make Postgres faster
# https://github.com/testjavascript/nodejs-integration-tests-best-practices#%EF%B8%8F-4-optimize-your-real-db-for-testing-dont-fake-it
command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c random_page_cost=1.0
environment:
POSTGRES_MULTIPLE_DATABASES: ${DB_DB}_test
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DB}
redis:
image: redis:7.0-alpine
restart: always
ports:
- '$REDIS_PORT:6379'
volumes:
- redisdata:/data
command: redis-server --save 20 1 --loglevel warning --requirepass $REDIS_PASSWORD
volumes:
pgdata:
redisdata: