forked from PabloCastellano/libreborme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
76 lines (70 loc) · 1.77 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
---
version: "2.4"
services:
postgres:
image: postgres:9.5
volumes:
- db-data:/var/lib/postgresql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: &db_user libreborme
POSTGRES_PASSWORD: &db_pass libreborme
POSTGRES_DB: &db_name libreborme
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.9
ports:
- "9200:9200"
environment:
discovery.type: single-node
xpack.security.enabled: "false"
django_base: &django
image: libreborme
build:
context: .
dockerfile: Dockerfile
args:
PYTHON_VERSION: 3.6
ENV: production
APP_DIR: /app
target: final
depends_on:
postgres:
condition: service_healthy
elasticsearch:
condition: service_started
environment:
DATABASES_DEFAULT_NAME: *db_name
DATABASES_DEFAULT_USER: *db_user
DATABASES_DEFAULT_PASSWORD: *db_pass
DATABASES_DEFAULT_HOST: postgres
DATABASES_DEFAULT_PORT: 5432
ELASTICSEARCH_URI: http://elastic:changeme@elasticsearch:9200
ALLOWED_HOSTS: "127.0.0.1,localhost"
django_init:
<<: *django
command:
- sh
- -c
- "python manage.py migrate; python manage.py loaddata libreborme/fixtures/config.json; echo yes |python manage.py collectstatic"
django:
<<: *django
ports:
- "8000:8000"
healthcheck:
test: "/usr/bin/wget --quiet --tries=1 --spider http://localhost:8000/healthz/ || exit 1"
interval: 10s
timeout: 5s
retries: 5
command:
- python
- manage.py
- runserver
- 0.0.0.0:8000
volumes:
db-data: