diff --git a/.env.dev.example b/.env.dev.example index 191d2de9d..4e21f1ca6 100644 --- a/.env.dev.example +++ b/.env.dev.example @@ -21,6 +21,7 @@ BOOKWYRM_DATABASE_BACKEND=postgres MEDIA_ROOT=images/ +POSTGRES_PORT=5432 POSTGRES_PASSWORD=securedbpassword123 POSTGRES_USER=fedireads POSTGRES_DB=fedireads diff --git a/.env.prod.example b/.env.prod.example index ac9fe70f8..a82499a32 100644 --- a/.env.prod.example +++ b/.env.prod.example @@ -21,6 +21,7 @@ BOOKWYRM_DATABASE_BACKEND=postgres MEDIA_ROOT=images/ +POSTGRES_PORT=5432 POSTGRES_PASSWORD=securedbpassword123 POSTGRES_USER=fedireads POSTGRES_DB=fedireads diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 45d8cb9d6..d694e33fd 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -118,7 +118,7 @@ BOOKWYRM_DBS = { "USER": env("POSTGRES_USER", "fedireads"), "PASSWORD": env("POSTGRES_PASSWORD", "fedireads"), "HOST": env("POSTGRES_HOST", ""), - "PORT": 5432, + "PORT": env("POSTGRES_PORT", 5432), }, } diff --git a/docker-compose.yml b/docker-compose.yml index d961a3c06..1990801d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,30 +53,26 @@ services: - 8000:8000 redis_activity: image: redis - command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD} --appendonly yes + command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD} --appendonly yes --port ${REDIS_ACTIVITY_PORT} volumes: - ./redis.conf:/etc/redis/redis.conf + - redis_activity_data:/data env_file: .env - ports: - - 6378:6378 networks: - main restart: on-failure - volumes: - - redis_activity_data:/data redis_broker: image: redis - command: redis-server --requirepass ${REDIS_BROKER_PASSWORD} --appendonly yes + command: redis-server --requirepass ${REDIS_BROKER_PASSWORD} --appendonly yes --port ${REDIS_BROKER_PORT} volumes: - ./redis.conf:/etc/redis/redis.conf + - redis_broker_data:/data env_file: .env ports: - 6379:6379 networks: - main restart: on-failure - volumes: - - redis_broker_data:/data celery_worker: env_file: .env build: . @@ -93,7 +89,7 @@ services: restart: on-failure flower: build: . - command: flower --port=8888 --basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD} + command: flower --port=${FLOWER_PORT} --basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD} env_file: .env environment: - CELERY_BROKER_URL=${CELERY_BROKER}