forked from paycrest/aggregator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
58 lines (55 loc) · 1.36 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
services:
postgres_db:
container_name: paycrest_db
image: postgres:16-alpine3.17
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
volumes:
- ./tmp/db:/var/lib/postgresql/data
ports:
- ${DB_PORT}:5432
restart: always
redis:
container_name: paycrest_redis
image: redis:7.2-alpine
environment:
- REDIS_DB=0
- REDIS_PASSWORD=${REDIS_PASSWORD}
ports:
- ${REDIS_PORT}:6379
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
restart: always
server:
container_name: paycrest_aggregator
build:
context: .
dockerfile: Dockerfile
ports:
- ${SERVER_PORT}:${SERVER_PORT}
depends_on:
- postgres_db
links:
- postgres_db:postgres_db
volumes:
- .:/app
- tmpfs-cache:/root/.cache/go-build # Add tmpfs volume for build cache
deploy:
resources:
limits:
memory: 8G # Set memory limit
reservations:
memory: 4G # Guaranteed memory
tmpfs:
- /root/.cache/go-build:rw,noexec,nosuid,size=2G # Mount tmpfs for build cache
restart: always
# Define volumes
volumes:
tmpfs-cache:
driver: local
driver_opts:
type: tmpfs
device: tmpfs