add proper healthcheck/wait for postgres in docker-compose and fix docker/local_settings.py

This commit is contained in:
Jonathan Math 2021-03-14 16:17:14 -05:00
parent 2e7647a715
commit ee49bc97b2
2 changed files with 20 additions and 18 deletions

View file

@ -13,10 +13,14 @@ services:
tty: true
restart: always
depends_on:
- db_mongo
- db_postgres
- db_redis
- db_elasticsearch
db_mongo:
condition: service_started
db_postgres:
condition: service_healthy
db_redis:
condition: service_started
db_elasticsearch:
condition: service_started
ulimits:
nproc: 10000
nofile:
@ -177,8 +181,6 @@ services:
- 80:80
- 443:443
- 1936:1936
environment:
- DOCKERBUILD=True
volumes:
- ./docker/haproxy/haproxy.docker-compose.cfg:/usr/local/etc/haproxy/haproxy.cfg
- app-files:/srv/newsblur

View file

@ -29,7 +29,7 @@ ENFORCE_SIGNUP_CAPTCHA = False
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': 'redis:6379',
'LOCATION': 'db_redis:6379',
'OPTIONS': {
'DB': 6,
'PARSER_CLASS': 'redis.connection.HiredisParser'
@ -75,19 +75,19 @@ DATABASES = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'newsblur',
'PASSWORD': 'newsblur',
'HOST': 'postgres',
'HOST': 'db_postgres',
},
}
MONGO_DB = {
'name': 'newsblur',
'host': 'mongo',
'host': 'db_mongo',
'port': 27017
}
MONGO_ANALYTICS_DB = {
'name': 'analytics',
'host': 'mongo',
'host': 'db_mongo',
'port': 27017
}
@ -96,27 +96,27 @@ MONGODB_SLAVE = {
}
# Celery RabbitMQ/Redis Broker
BROKER_URL = "redis://redis:6379/0"
BROKER_URL = "redis://db_redis:6379/0"
CELERY_RESULT_BACKEND = BROKER_URL
REDIS = {
'host': 'redis',
'host': 'db_redis',
}
REDIS_PUBSUB = {
'host': 'redis',
'host': 'db_redis',
}
REDIS_PUBSUB_POOL = {
'host': 'redis',
'host': 'db_redis',
}
REDIS_STORY = {
'host': 'redis',
'host': 'db_redis',
}
REDIS_SESSIONS = {
'host': 'redis',
'host': 'db_redis',
}
ELASTICSEARCH_FEED_HOSTS = ["elasticsearch:9200"]
ELASTICSEARCH_STORY_HOSTS = ["elasticsearch:9200"]
ELASTICSEARCH_FEED_HOSTS = ["db_elasticsearch:9200"]
ELASTICSEARCH_STORY_HOSTS = ["db_elasticsearch:9200"]
BACKED_BY_AWS = {
'pages_on_node': False,