-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
71 lines (71 loc) · 1.56 KB
/
compose.yaml
File metadata and controls
71 lines (71 loc) · 1.56 KB
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
65
66
67
68
69
70
71
name: django-redis-postgres
services:
app:
build:
context: ./app
dockerfile: Dockerfile
ports:
- target: 8000
published: 8000
mode: ingress
environment:
- REDIS_URL=redis://redis-service:6379
- POSTGRES_URL=postgres://djangouser:${POSTGRES_PASSWORD}@postgres-service:5432/djangodatabase?
- SECRET_KEY
healthcheck:
test:
- CMD
- python3
- -c
- import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read()
- http://localhost:8000/
interval: 10s
depends_on:
- redis-service
- postgres-service
- migrate
deploy:
resources:
reservations:
cpus: '0.5'
memory: 512M
redis-service:
image: redis:6.2
ports:
- mode: host
target: 6379
deploy:
resources:
reservations:
cpus: '0.5'
memory: 512M
migrate:
restart: 'no'
build:
context: ./app
dockerfile: Dockerfile
command: python manage.py migrate
depends_on:
- postgres-service
environment:
- POSTGRES_URL=postgres://djangouser:${POSTGRES_PASSWORD}@postgres-service:5432/djangodatabase?
- SECRET_KEY
deploy:
resources:
reservations:
cpus: '0.5'
memory: 512M
postgres-service:
image: postgres:16.4
ports:
- mode: host
target: 5432
environment:
- POSTGRES_PASSWORD
- POSTGRES_DB=djangodatabase
- POSTGRES_USER=djangouser
deploy:
resources:
reservations:
cpus: '0.5'
memory: 512M