Add celery support to docker config

This commit is contained in:
rubenwardy 2019-01-09 22:29:05 +00:00
parent a45df0e173
commit 7d52931a20
2 changed files with 20 additions and 16 deletions

@ -1,4 +1,4 @@
FROM python:3.7 FROM python:3.6
WORKDIR /home/cdb WORKDIR /home/cdb
@ -14,6 +14,3 @@ COPY setup.py ./setup.py
COPY app app COPY app app
COPY migrations migrations COPY migrations migrations
COPY config.prod.cfg ./config.prod.cfg COPY config.prod.cfg ./config.prod.cfg
EXPOSE 5123
ENTRYPOINT ["./runprodguni.sh"]

@ -6,24 +6,31 @@ services:
volumes: volumes:
- "./data/db:/var/lib/postgresql/data" - "./data/db:/var/lib/postgresql/data"
env_file: env_file:
- db.env - config.env
networks:
- db_nw redis:
image: 'redis:3.0-alpine'
command: redis-server
volumes:
- './data/redis:/data'
app: app:
build: . build: .
command: ./runprodguni.sh
ports: ports:
- 5123:5123 - 5123:5123
volumes: volumes:
- "./data/uploads:/home/app/public/uploads" - "./data/uploads:/home/cdb/app/public/uploads"
networks:
- db_nw
- web_nw
depends_on: depends_on:
- db - db
- redis
networks: worker:
db_nw: build: .
driver: bridge command: celery -A app.tasks.celery worker
web_nw: env_file:
driver: bridge - config.env
volumes:
- "./data/uploads:/home/cdb/app/public/uploads"
depends_on:
- redis