dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

Docker compose clean up

Open Freika opened this issue 1 year ago • 2 comments

ENV vars removed from the docker-compose.yml:

      TIME_ZONE: Europe/London
      APPLICATION_PROTOCOL: http
      DISTANCE_UNIT: km
      PHOTON_API_HOST: photon.komoot.io
      PHOTON_API_USE_HTTPS: true
      MIN_MINUTES_SPENT_IN_CITY: 60
      APPLICATION_HOST: localhost

Link to the https://dawarich.app/docs/environment-variables-and-settings page added instead, and the app itself is now using defaults that can be changed if env vars are provided.

Freika avatar Dec 01 '24 13:12 Freika

I would also suggest to remove some duplicate environment variables by using env_file. To overwrite PROMETHEUS_EXPORTER_ENABLED and PROMETHEUS_EXPORTER_HOST in dawarich_sidekiq, only these two variables could be included in an environment section (see also https://docs.docker.com/compose/how-tos/environment-variables/envvars-precedence/).

Maybe also DATABASE_USERNAME and DATABASE_PASSWORD could be used in dawarich_db instead of POSTGRES_USER and POSTGRES_PASSWORD.

One sample env_file (which could also include docs/defaults):

POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
RAILS_ENV=development
REDIS_URL=redis://dawarich_redis:6379/0
DATABASE_HOST=dawarich_db
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=password
DATABASE_NAME=dawarich_development
MIN_MINUTES_SPENT_IN_CITY=60
APPLICATION_HOST=localhost
APPLICATION_HOSTS=localhost
TIME_ZONE=Europe/London
APPLICATION_PROTOCOL=http
DISTANCE_UNIT=km
REVERSE_GEOCODING_ENABLED=false
PHOTON_API_HOST=photon.komoot.io
PHOTON_API_USE_HTTPS=true
PROMETHEUS_EXPORTER_ENABLED=false
PROMETHEUS_EXPORTER_HOST=0.0.0.0
PROMETHEUS_EXPORTER_PORT=9394
BACKGROUND_PROCESSING_CONCURRENCY=10

tohn avatar Dec 02 '24 09:12 tohn

@tohn I prefer having all env vars in the compose file by default

Freika avatar Feb 11 '25 21:02 Freika