NewsBlur/docker-compose.yml

265 lines
6.5 KiB
YAML
Raw Normal View History

version: '3'
services:
newsblur_web:
container_name: newsblur_web
image: newsblur/newsblur_python3
environment:
- DOCKERBUILD=True
stdin_open: true
tty: true
links:
- db_mongo
- postgres
- elasticsearch
- redis
restart: always
depends_on:
- db_mongo
- postgres
- redis
- elasticsearch
ulimits:
nproc: 10000
nofile:
soft: 10000
hard: 10000
ports:
- '8000:8000'
# only use gunicorn if the TEST env variable is not "True"
command: bash -c 'if [[ -z "${TEST}" && "${TEST}" = "True" ]] ; then echo "starting test env"; else gunicorn --bind :8000 newsblur_web.wsgi:application; fi'
volumes:
- app-files:/srv/newsblur
nginx:
container_name: nginx
image: nginx:1.13
ports:
- 81:81
depends_on:
- newsblur_web
- favicons
- postgres
- redis
- db_mongo
- elasticsearch
- original_pages
- original_text
- node_websocket
environment:
- DOCKERBUILD=True
volumes:
- ./docker/nginx:/etc/nginx/conf.d
- app-files:/srv/newsblur
postgres:
container_name: postgres
image: postgres:9.6
environment:
- POSTGRES_USER=newsblur
- POSTGRES_PASSWORD=newsblur
ports:
- '5432:5432'
volumes:
- ./docker/volumes/postgres:/var/lib/postgresql/data
redis:
image: redis:3
ports:
2020-10-26 10:36:24 +07:00
- '6579:6579'
container_name: redis
volumes:
- ./docker/volumes/redis:/data
- ./config/redis.conf:/usr/local/etc/redis_server.conf
- ./config/redis_docker.conf:/etc/redis_server.conf
- ./docker/volumes/redis.var.lib:/var/lib/redis
2020-10-26 10:36:24 +07:00
command: redis-server --port 6579
elasticsearch:
container_name: elasticsearch
image: elasticsearch:1.7
ports:
- '9200:9200'
volumes:
- ./docker/volumes/elasticsearch:/usr/share/elasticsearch/data
db_mongo:
container_name: db_mongo
image: mongo:3.2
ports:
- 29019:29019
command: mongod --smallfiles --port 29019
volumes:
- ./docker/volumes/db_mongo:/data/db
original_pages:
image: newsblur/newsblur_node
container_name: node_original_page
environment:
- NODE_ENV=development
command: node original_page.js
ports:
- 3060:3060
volumes:
- node-files:/usr/src/app
original_text:
image: newsblur/newsblur_node
container_name: node_original_text
environment:
- NODE_ENV=development
ports:
- 4040:4040
2020-10-26 10:04:17 +07:00
command: node original_text.js
volumes:
- node-files:/usr/src/app
favicons:
image: newsblur/newsblur_node
container_name: node_favicons
environment:
- NODE_ENV=docker
- MONGO_PORT=29019
ports:
- 3030:3030
command: node favicons.js
depends_on:
- postgres
volumes:
- node-files:/usr/src/app
node_websocket:
container_name: node_websocket
image: newsblur/newsblur_node
environment:
- NODE_ENV=docker
command: node unread_counts.js
stop_signal: HUP
ports:
- 8888:8888
volumes:
- node-files:/usr/src/app
celerybeat:
container_name: celerybeat
image: newsblur/newsblur_python3
command: bash -c "mkdir -p data && celery beat -A newsblur_web --schedule=/srv/newsblur/data/celerybeat-schedule.db --loglevel=INFO --pidfile=/srv/celeryd.pid"
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
- ./config:/etc/supervisor/conf.d/
celeryd:
container_name: celeryd
image: newsblur/newsblur_python3
command: "celery worker -A newsblur_web --loglevel=INFO -Q new_feeds,push_feeds,update_feeds"
volumes:
- app-files:/srv/newsblur
environment:
- DOCKERBUILD=True
user: "${CURRENT_UID}:${CURRENT_GID}"
celeryd_beat:
container_name: celeryd_beat
image: newsblur/newsblur_python3
command: "celery worker -A newsblur_web --loglevel=INFO -Q beat_tasks -c 3"
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
user: "${CURRENT_UID}:${CURRENT_GID}"
celeryd_beat_feeds:
container_name: celeryd_beat_feeds
image: newsblur/newsblur_python3
command: "celery worker -A newsblur_web --loglevel=INFO -Q beat_feeds_task -c 1"
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
user: "${CURRENT_UID}:${CURRENT_GID}"
celeryd_news:
container_name: celeryd_news
image: newsblur/newsblur_python3
command: "celery worker -A newsblur_web --loglevel=INFO -Q new_feeds,push_feeds"
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
user: "${CURRENT_UID}:${CURRENT_GID}"
celeryd_search_indexer:
container_name: celeryd_search_indexer
image: newsblur/newsblur_python3
command: "celery worker -A newsblur_web --loglevel=INFO -Q search_indexer -c 4"
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
user: $CURRENT_UID:$CURRENT_GID
celeryd_search_indexer_tasker:
container_name: celeryd_search_indexer_tasker
image: newsblur/newsblur_python3
command: "celery worker -A newsblur_web --loglevel=INFO -Q search_indexer_tasker -c 2"
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
user: $CURRENT_UID:$CURRENT_GID
celeryd_work_queue:
container_name: celeryd_work_queue
image: newsblur/newsblur_python3
command: bash -c "celery worker -A newsblur_web --loglevel=INFO -Q work_queue"
ports:
- 82:82
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
user: $CURRENT_UID:$CURRENT_GID
monitor:
container_name: monitor
image: newsblur/newsblur_python3
command: bash -c "python /srv/newsblur/flask_monitor/db_monitor.py"
environment:
- DOCKERBUILD=True
volumes:
- app-files:/srv/newsblur
ports:
2020-10-25 12:26:41 +07:00
- 5579:5579
haproxy:
domainname: 'nb.local.com'
container_name: haproxy
build:
context: .
dockerfile: docker/haproxy/Dockerfile
depends_on:
- nginx
- newsblur_web
- redis
ports:
- 80:80
- 443:443
- 1936:1936
environment:
- DOCKERBUILD=True
volumes:
- ./docker/haproxy/haproxy.conf:/usr/local/etc/haproxy/haproxy.cfg
- app-files:/srv/newsblur
volumes:
app-files:
driver_opts:
type: nfs
device: $PWD
o: bind
node-files:
driver_opts:
type: nfs
device: $PWD/node
o: bind