forked from alexmerser/hackerspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
83 lines (81 loc) · 2.25 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
version: '2.2' # supported by default install on Ubuntu 18.04
###############################################################################
#
# FOR DOCKER-COMPOSE SETTINGS COMMON TO BOTH DEVELOPMENT AND PRODUCTION
#
# Do not edit this file for development changes only, instead use docker-compose.overide.yml
#
# https://docs.docker.com/compose/extends/
################################################################################
services:
db:
container_name: db
build: ./postgresql
expose:
- "5432"
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_HOST_AUTH_METHOD: "trust" # http://support.divio.com/en/articles/3719228-database-is-uninitialized-and-superuser-password-is-not-specified
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: "redis:5.0-alpine"
sysctls:
# Resolve -> # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
net.core.somaxconn: 512
ports:
- 6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
web:
#restart: unless-stopped
build: .
env_file: .env
# command: # see docker-compose.overide.yml or docker-compose.prod.yml
volumes:
- .:/app
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
links:
- db:db
celery:
build: .
env_file: .env
command: bash -c "cd src &&
celery -A hackerspace_online worker -l info -c 3 -Q default"
volumes:
- .:/app
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
celery-beat:
build: .
env_file: .env
command: bash -c "cd src &&
celery -A hackerspace_online beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
volumes:
- .:/app
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
postgres_data:
redis_data: