-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
112 lines (107 loc) · 3.05 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
version: "3"
services:
nginx:
container_name: oais_nginx
build:
context: nginx/
ports:
- 80:80
volumes:
- ./oais-web:/oais_web
depends_on:
- django
db:
container_name: oais_psql
image: registry.cern.ch/docker.io/library/postgres:14
environment:
- POSTGRES_DB=oais_platform
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=overwritethisinprod!
- PGDATA=/data/postgres
volumes:
- postgres:/data/postgres
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 10s
retries: 50
pgadmin:
container_name: oais_pgadmin
image: registry.cern.ch/docker.io/dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: "False"
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- "5050:80"
restart: unless-stopped
# Django app
django:
container_name: oais_django
# Current path contains the Dockerfile for the Django app
build:
context: .
ports:
- "8000:8000"
volumes:
- .:/oais_platform
command:
# Wait for the database to be online
# Run Django migrations (create tables on the db from the models)
# Create OpenAPI specification with `rdf-spectacular` and output it in schema.yml
# Bring up the web server on port 8000
>
sh -c "python3 manage.py migrate &&
python3 manage.py spectacular --file schema.yml &&
python3 manage.py runserver 0.0.0.0:8000"
environment:
# Point to the postgres service
- DB_HOST=db
- DB_USER=postgres
- DB_PASS=overwritethisinprod!
- DB_NAME=oais_platform
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- INVENIO_API_TOKEN=<YOUR_INVENIO_API_TOKEN_HERE>
- INVENIO_SERVER_URL=<YOUR_INVENIO_SERVER_URL_HERE>
- ALLOW_LOCAL_LOGIN=True
env_file:
- ./.env.dev
depends_on:
db:
condition: service_healthy
# Redis
redis:
container_name: oais_redis
image: registry.cern.ch/docker.io/library/redis:7-alpine
celery:
container_name: oais_celery
restart: always
build:
context: .
command: celery -A oais_platform.celery worker -l INFO -B --scheduler django_celery_beat.schedulers:DatabaseScheduler
volumes:
- .:/oais_platform
env_file:
- ./.env.dev
depends_on:
- db
- redis
- django
environment:
# Point to the redis service
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- DATABASE_URL=postgres://postgres:postgres@db:5433/web_dev
- DB_HOST=db
- DB_NAME=oais_platform
- DB_USER=postgres
- DB_PASS=overwritethisinprod!
- INVENIO_API_TOKEN=<YOUR_INVENIO_API_TOKEN_HERE>
- INVENIO_SERVER_URL=<YOUR_INVENIO_SERVER_URL_HERE>
volumes:
postgres:
pgadmin: