generated from roniemartinez/docker-django-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
75 lines (73 loc) · 1.72 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
version: "3.8"
volumes:
pg_data:
es_data: {}
services:
database:
image: library/postgres:14-alpine
container_name: combio_db
restart: on-failure
env_file:
- env/database.env
expose:
- 5432
volumes:
- ./database/scripts:/docker-entrypoint-initdb.d
- pg_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ] # TODO: find a way to dynamically get the username
interval: 10s
timeout: 5s
retries: 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
container_name: combio_es
environment:
- discovery.type=single-node
- xpack.security.http.ssl.enabled=false
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=elastic
volumes:
- es_data:/usr/share/elasticsearch/data
ports:
- 9200:9200
web:
build: .
container_name: combio_web
image: combio_web
command:
- /bin/sh
- -c
- |
python manage.py compilemessages
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic --noinput
bash runserver.sh
volumes:
- .:/code
expose:
- 8081
- 6800
env_file:
- env/app.env
- env/database.env
depends_on:
database:
condition: service_healthy
elasticsearch:
condition: service_started
links:
- database
nginx:
image: library/nginx:latest
container_name: combio_nginx
ports:
- "127.0.0.1:8081:8081"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/conf.d:/etc/nginx/conf.d
- ./static:/static
- ./media:/media
depends_on:
- web