-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.docker-compose.yaml
64 lines (62 loc) · 1.75 KB
/
test.docker-compose.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: "3.9"
services:
postgres:
image: postgres:14.8-alpine3.18
container_name: test_postgres
environment:
PGDATA: "/var/lib/postgresql/data/pgdata"
env_file: ".test.env"
volumes:
- aithc-test-data:/var/lib/postgresql/data
ports:
- "5431:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER -d aithc-test"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1'
memory: 2G
redis:
image: redis:latest
container_name: test_redis
env_file: ".test.env"
ports:
- "6378:6379"
volumes:
- cache-test-data:/data
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
command: >
sh -c '
mkdir -p /usr/local/etc/redis &&
echo "bind 0.0.0.0" > /usr/local/etc/redis/redis.conf &&
echo "requirepass $REDIS_PASSWORD" >> /usr/local/etc/redis/redis.conf &&
echo "appendonly yes" >> /usr/local/etc/redis/redis.conf &&
echo "appendfsync everysec" >> /usr/local/etc/redis/redis.conf &&
echo "user default on nopass ~* +@all" > /usr/local/etc/redis/users.acl &&
echo "user $REDIS_USER on >$REDIS_USER_PASSWORD ~* +@all" >> /usr/local/etc/redis/users.acl &&
redis-server /usr/local/etc/redis/redis.conf --aclfile /usr/local/etc/redis/users.acl
'
healthcheck:
test: [ "CMD", "redis-cli", "-a", "$REDIS_PASSWORD", "ping" ]
interval: 30s
timeout: 10s
retries: 5
restart: unless-stopped
tty: true
stdin_open: true
volumes:
aithc-test-data:
cache-test-data: