File tree 3 files changed +56
-5
lines changed 3 files changed +56
-5
lines changed Original file line number Diff line number Diff line change
1
+ FROM python:3.6
2
+ ENV PYTHONUNBUFFERED 1
3
+ RUN mkdir /code
4
+ WORKDIR /code
5
+ ADD requirements.txt /code/
6
+ RUN pip install -r requirements.txt
7
+ ADD . /code/
Original file line number Diff line number Diff line change 81
81
DATABASES = {
82
82
'default' : {
83
83
'ENGINE' : 'django.db.backends.postgresql' ,
84
- 'NAME' : 'django-rocket-db ' ,
85
- 'USER' : 'django-rocket-user ' ,
84
+ 'NAME' : 'postgres ' ,
85
+ 'USER' : 'postgres ' ,
86
86
'PASSWORD' : 'bottomsecret' ,
87
- 'HOST' : '127.0.0.1 ' ,
87
+ 'HOST' : 'db ' ,
88
88
'PORT' : '5432' ,
89
89
}
90
90
}
129
129
STATIC_URL = '/static/'
130
130
131
131
# Celery task queue configs
132
- CELERY_BROKER_URL = 'redis://localhost :6379/0'
133
- CELERY_RESULT_BACKEND = 'redis://localhost :6379/0'
132
+ CELERY_BROKER_URL = 'redis://redis :6379/0'
133
+ CELERY_RESULT_BACKEND = 'redis://redis :6379/0'
134
134
CELERY_BEAT_SCHEDULE = {
135
135
# Only for demo (run every minute), should remove in production
136
136
'demo-scheduled-task' : {
Original file line number Diff line number Diff line change
1
+ version : ' 3.6'
2
+
3
+ services :
4
+ db :
5
+ image : " postgres:10-alpine"
6
+ ports :
7
+ - " 5432:5432"
8
+ environment :
9
+ POSTGRES_PASSWORD : bottomsecret
10
+ volumes :
11
+ - postgres_data:/var/lib/postgresql/data/
12
+ redis :
13
+ image : " redis:4-alpine"
14
+ volumes :
15
+ - redis_data:/data
16
+ ports :
17
+ - " 6379:6379"
18
+ worker :
19
+ build : .
20
+ command : celery worker --app django_rocket --loglevel info --logfile celery-worker.log
21
+ volumes :
22
+ - .:/code
23
+ depends_on :
24
+ - redis
25
+ schedule :
26
+ build : .
27
+ command : celery beat --app django_rocket --loglevel info --logfile celery-beat.log
28
+ volumes :
29
+ - .:/code
30
+ depends_on :
31
+ - redis
32
+ web :
33
+ build : .
34
+ command : bash -c "python manage.py migrate --noinput && python manage.py runserver 0.0.0.0:8000"
35
+ volumes :
36
+ - .:/code
37
+ ports :
38
+ - " 8000:8000"
39
+ depends_on :
40
+ - db
41
+ - redis
42
+ volumes :
43
+ postgres_data :
44
+ redis_data :
You can’t perform that action at this time.
0 commit comments