forked from Code4PuertoRico/contratospr-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
91 lines (84 loc) · 1.99 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
version: '3'
volumes:
database:
external: false
redis:
external: false
services:
database:
image: postgres:9.6
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=password
volumes:
- database:/var/lib/postgresql/data
- ./docker/postgres:/docker-entrypoint-initdb.d
redis:
image: redis:3.2
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis:/data
worker:
build:
context: .
dockerfile: Dockerfile
args:
PIPENV_ARGS: --dev
command: start-worker
entrypoint: /app/bin/docker-entrypoint
restart: on-failure
environment:
- PYTHONUNBUFFERED=1
- DJANGO_SECRET_KEY=dont-tell-eve
- DATABASE_URL=postgres://postgres:password@database/postgres
- REDIS_URL=redis://redis:6379
volumes:
- .:/app
links:
- database:database
- redis:redis
web:
build:
context: .
dockerfile: Dockerfile
args:
PIPENV_ARGS: --dev
command: start-web
entrypoint: /app/bin/docker-entrypoint
restart: on-failure
environment:
- PYTHONUNBUFFERED=1
- DJANGO_SECRET_KEY=dont-tell-eve
- DATABASE_URL=postgres://postgres:password@database/postgres
- REDIS_URL=redis://redis:6379
volumes:
- .:/app
ports:
- '8000:8000'
links:
- database:database
- redis:redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/readiness/"]
interval: 30s
timeout: 10s
retries: 3
tests:
build:
context: .
dockerfile: Dockerfile
args:
PIPENV_ARGS: --dev
command: run-tests
entrypoint: /app/bin/docker-entrypoint
environment:
- ENVIRONMENT=testing
- DATABASE_URL=postgres://postgres:password@database/postgres
- REDIS_URL=redis://redis:6379
- DJANGO_SECRET_KEY=dont-tell-eve
volumes:
- .:/app
links:
- database:database
- redis:redis