-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
47 lines (44 loc) · 970 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
41
42
43
44
45
46
47
services:
app:
environment:
- ENV=${ENV}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- DATABASE_HOST=${DB_HOST}
- DATABASE_PORT=${DB_PORT}
tty: true
build:
context: .
dockerfile: Dockerfile
args:
ENV: ${ENV}
ports:
- 8000:8000
restart: on-failure
volumes:
- .:/app
depends_on:
- postgres
- redis
postgres:
image: postgres:latest
restart: always
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- DATABASE_HOST=${DB_HOST}
ports:
- 5432:5432
volumes:
- ./pg_data:/var/lib/postgresql/data
redis:
image: redis:alpine
command: ["redis-server", "--maxmemory", "2gb", "--maxmemory-policy", "allkeys-lru"]
mem_limit: 2g
mem_reservation: 1g
ports:
- 6379:6379
volumes:
pg_data: