From c0f9de40573932b303e0b72257ae43b2f51f86c4 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 8 Feb 2025 23:27:27 +0100 Subject: [PATCH] Change default PostgreSQL image to Postgis --- CHANGELOG.md | 6 +- docker/docker-compose.production.yml | 2 +- docker/docker-compose_mounted_volumes.yml | 159 ---------------------- docs/synology/docker-compose.yml | 2 +- 4 files changed, 5 insertions(+), 164 deletions(-) delete mode 100644 docker/docker-compose_mounted_volumes.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dc05172..150a9428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -327,7 +327,7 @@ To mount a custom `postgresql.conf` file, you need to create a `postgresql.conf` ```diff dawarich_db: - image: postgres:14.2-alpine + image: postgis/postgis:14-3.5-alpine shm_size: 1G container_name: dawarich_db volumes: @@ -358,7 +358,7 @@ An example of a custom `postgresql.conf` file is provided in the `postgresql.con ```diff ... dawarich_db: - image: postgres:14.2-alpine + image: postgis/postgis:14-3.5-alpine + shm_size: 1G ... ``` @@ -1299,7 +1299,7 @@ deploy: - shared_data:/var/shared/redis + restart: always dawarich_db: - image: postgres:14.2-alpine + image: postgis/postgis:14-3.5-alpine container_name: dawarich_db volumes: - db_data:/var/lib/postgresql/data diff --git a/docker/docker-compose.production.yml b/docker/docker-compose.production.yml index a4b83a34..42b64370 100644 --- a/docker/docker-compose.production.yml +++ b/docker/docker-compose.production.yml @@ -17,7 +17,7 @@ services: start_period: 30s timeout: 10s dawarich_db: - image: postgres:17-alpine + image: postgres:17-alpine # TODO: Use postgis here shm_size: 1G container_name: dawarich_db volumes: diff --git a/docker/docker-compose_mounted_volumes.yml b/docker/docker-compose_mounted_volumes.yml deleted file mode 100644 index ef61f49a..00000000 --- a/docker/docker-compose_mounted_volumes.yml +++ /dev/null @@ -1,159 +0,0 @@ -networks: - dawarich: - - -volumes: - dawarich_public: - name: dawarich_public - dawarich_keydb: - name: dawarich_keydb - dawarich_shared: - name: dawarich_shared - watched: - name: dawarich_watched - -services: - app: - container_name: dawarich_app - image: freikin/dawarich:latest - restart: unless-stopped - depends_on: - db: - condition: service_healthy - restart: true - keydb: - condition: service_healthy - restart: true - networks: - - dawarich - ports: - - 3000:3000 - environment: - TIME_ZONE: Europe/London - RAILS_ENV: development - REDIS_URL: redis://keydb:6379/0 - DATABASE_HOST: db - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_NAME: dawarich_development - MIN_MINUTES_SPENT_IN_CITY: 60 - APPLICATION_HOSTS: localhost - APPLICATION_PROTOCOL: http - DISTANCE_UNIT: km - stdin_open: true - tty: true - entrypoint: dev-entrypoint.sh - command: [ 'bin/dev' ] - volumes: - - dawarich_public:/var/app/dawarich_public - - watched:/var/app/tmp/imports/watched - healthcheck: - test: [ "CMD-SHELL", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'" ] - start_period: 60s - interval: 15s - timeout: 5s - retries: 3 - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" - deploy: - resources: - limits: - cpus: '0.50' # Limit CPU usage to 50% of one core - memory: '2G' # Limit memory usage to 2GB - - sidekiq: - container_name: dawarich_sidekiq - hostname: sidekiq - image: freikin/dawarich:latest - restart: unless-stopped - depends_on: - app: - condition: service_healthy - restart: true - db: - condition: service_healthy - restart: true - keydb: - condition: service_healthy - restart: true - networks: - - dawarich - environment: - RAILS_ENV: development - REDIS_URL: redis://keydb:6379/0 - DATABASE_HOST: db - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_NAME: dawarich_development - APPLICATION_HOSTS: localhost - BACKGROUND_PROCESSING_CONCURRENCY: 10 - APPLICATION_PROTOCOL: http - DISTANCE_UNIT: km - stdin_open: true - tty: true - entrypoint: dev-entrypoint.sh - command: [ 'sidekiq' ] - volumes: - - dawarich_public:/var/app/dawarich_public - - watched:/var/app/tmp/imports/watched - logging: - driver: "json-file" - options: - max-size: "100m" - max-file: "5" - healthcheck: - test: [ "CMD-SHELL", "bundle exec sidekiqmon processes | grep $${HOSTNAME}" ] - interval: 10s - retries: 5 - start_period: 30s - timeout: 10s - deploy: - resources: - limits: - cpus: '0.50' # Limit CPU usage to 50% of one core - memory: '2G' # Limit memory usage to 2GB - - keydb: - container_name: dawarich-keydb - image: eqalpha/keydb:x86_64_v6.3.4 - restart: unless-stopped - networks: - - dawarich - environment: - - TZ=Europe/London - - PUID=1000 - - PGID=1000 - command: keydb-server /etc/keydb/keydb.conf --appendonly yes --server-threads 4 --active-replica no - volumes: - - dawarich_keydb:/data - - dawarich_shared:/var/shared/redis - healthcheck: - test: [ "CMD", "keydb-cli", "ping" ] - start_period: 60s - interval: 15s - timeout: 5s - retries: 3 - - db: - container_name: dawarich-db - hostname: db - image: postgres:16.4-alpine3.20 - restart: unless-stopped - networks: - - dawarich - environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - POSTGRES_DATABASE: dawarich - volumes: - - ./db:/var/lib/postgresql/data - - dawarich_shared:/var/shared - healthcheck: - test: [ "CMD-SHELL", "pg_isready -q -d $${POSTGRES_DATABASE} -U $${POSTGRES_USER} -h localhost" ] - start_period: 60s - interval: 15s - timeout: 5s - retries: 3 diff --git a/docs/synology/docker-compose.yml b/docs/synology/docker-compose.yml index 62092437..5b06bc21 100644 --- a/docs/synology/docker-compose.yml +++ b/docs/synology/docker-compose.yml @@ -10,7 +10,7 @@ services: - ./redis:/var/shared/redis dawarich_db: - image: postgres:14.2-alpine + image: postgis/postgis:14-3.5-alpine container_name: dawarich_db restart: unless-stopped environment: