This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
76 lines (69 loc) · 1.8 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: '3.6'
# Useful docs
# https://github.com/vishnubob/wait-for-it
# https://docs.docker.com/compose/startup-order/
# https://docs.docker.com/compose/django/#create-a-django-project
# http://blog.thoward37.me/articles/where-are-docker-images-stored/
# https://blog.syncano.io/configuring-running-django-celery-docker-containers-pt-1/
# https://github.com/docker/compose/issues/1049
# docker-compose rm --all && docker-compose pull && docker-compose build --no-cache && docker-compose up --force-recreate
services:
# django database storage
db:
image: mysql:5.6
restart: always
environment:
- MYSQL_ROOT_PASSWORD=docker
- MYSQL_DATABASE=docker
- MYSQL_USER=docker
- MYSQL_PASSWORD=docker
ports:
- "3302:3306"
# Redis (results backend)
redis:
image: redis:2.8.19
hostname: redis
# RabbitMQ (messaging broker)
rabbit:
hostname: rabbit
image: rabbitmq:3-management
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=mypass
ports:
- "5672:5672" # we forward this port because it's useful for debugging
- "15672:15672" # here, we can access rabbitmq management plugin
links:
- db
# Django web server
web:
build:
context: .
dockerfile: Dockerfile
hostname: web
volumes:
- .:/code
command: "./wait-for-it.sh -h db -p 3302 -- ./run_web.sh"
ports:
- "8000:8000"
depends_on:
- db
# image: tomnl/django-mogisite
# Celery worker
worker:
build:
context: .
dockerfile: Dockerfile
command: "./wait-for-it.sh -h rabbit -p 15672 -- ./run_celery.sh"
volumes:
- .:/code
links:
- db
- rabbit
- redis
depends_on:
- rabbit
- db
- web
- redis
#image: tomnl/celery-mogi