| 1 | sudo mkdir dawarich |
| 2 | cd dawarich |
| 3 | sudo wget |
docker-compose.yml
· 4.4 KiB · YAML
Ham
networks:
dawarich:
services:
dawarich_redis:
image: redis:7.4-alpine
container_name: dawarich_redis
command: redis-server
networks:
- dawarich
volumes:
- dawarich_shared:/data
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
dawarich_db:
image: postgis/postgis:17-3.5-alpine
shm_size: 1G
container_name: dawarich_db
volumes:
- dawarich_db_data:/var/lib/postgresql/data
- dawarich_shared:/var/shared
# - ./postgresql.conf:/etc/postgresql/postgresql.conf # Optional, uncomment if you want to use a custom config
networks:
- dawarich
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: dawarich_development
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d dawarich_development" ]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
# command: postgres -c config_file=/etc/postgresql/postgresql.conf # Use custom config, uncomment if you want to use a custom config
dawarich_app:
image: freikin/dawarich:latest
container_name: dawarich_app
volumes:
- dawarich_public:/var/app/public
- dawarich_watched:/var/app/tmp/imports/watched
- dawarich_storage:/var/app/storage
- dawarich_db_data:/dawarich_db_data
networks:
- dawarich
ports:
- 3000:3000
# - 9394:9394 # Prometheus exporter, uncomment if needed
stdin_open: true
tty: true
entrypoint: web-entrypoint.sh
command: ['bin/rails', 'server', '-p', '3000', '-b', '::']
restart: on-failure
environment:
RAILS_ENV: development
REDIS_URL: redis://dawarich_redis:6379
DATABASE_HOST: dawarich_db
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: password
DATABASE_NAME: dawarich_development
MIN_MINUTES_SPENT_IN_CITY: 60
APPLICATION_HOSTS: localhost
TIME_ZONE: Europe/London
APPLICATION_PROTOCOL: http
PROMETHEUS_EXPORTER_ENABLED: "false"
PROMETHEUS_EXPORTER_HOST: 0.0.0.0
PROMETHEUS_EXPORTER_PORT: 9394
SELF_HOSTED: "true"
STORE_GEODATA: "true"
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
healthcheck:
test: [ "CMD-SHELL", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'" ]
interval: 10s
retries: 30
start_period: 30s
timeout: 10s
depends_on:
dawarich_db:
condition: service_healthy
restart: true
dawarich_redis:
condition: service_healthy
restart: true
deploy:
resources:
limits:
cpus: '0.50' # Limit CPU usage to 50% of one core
memory: '4G' # Limit memory usage to 4GB
dawarich_sidekiq:
image: freikin/dawarich:latest
container_name: dawarich_sidekiq
volumes:
- dawarich_public:/var/app/public
- dawarich_watched:/var/app/tmp/imports/watched
- dawarich_storage:/var/app/storage
networks:
- dawarich
stdin_open: true
tty: true
entrypoint: sidekiq-entrypoint.sh
command: ['sidekiq']
restart: on-failure
environment:
RAILS_ENV: development
REDIS_URL: redis://dawarich_redis:6379
DATABASE_HOST: dawarich_db
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: password
DATABASE_NAME: dawarich_development
APPLICATION_HOSTS: localhost
BACKGROUND_PROCESSING_CONCURRENCY: 10
APPLICATION_PROTOCOL: http
PROMETHEUS_EXPORTER_ENABLED: "false"
PROMETHEUS_EXPORTER_HOST: dawarich_app
PROMETHEUS_EXPORTER_PORT: 9394
SELF_HOSTED: "true"
STORE_GEODATA: "true"
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
healthcheck:
test: [ "CMD-SHELL", "pgrep -f sidekiq" ]
interval: 10s
retries: 30
start_period: 30s
timeout: 10s
depends_on:
dawarich_db:
condition: service_healthy
restart: true
dawarich_redis:
condition: service_healthy
restart: true
dawarich_app:
condition: service_healthy
restart: true
volumes:
dawarich_db_data:
dawarich_shared:
dawarich_public:
dawarich_watched:
dawarich_storage:
| 1 | networks: |
| 2 | dawarich: |
| 3 | services: |
| 4 | dawarich_redis: |
| 5 | image: redis:7.4-alpine |
| 6 | container_name: dawarich_redis |
| 7 | command: redis-server |
| 8 | networks: |
| 9 | - dawarich |
| 10 | volumes: |
| 11 | - dawarich_shared:/data |
| 12 | restart: always |
| 13 | healthcheck: |
| 14 | test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] |
| 15 | interval: 10s |
| 16 | retries: 5 |
| 17 | start_period: 30s |
| 18 | timeout: 10s |
| 19 | dawarich_db: |
| 20 | image: postgis/postgis:17-3.5-alpine |
| 21 | shm_size: 1G |
| 22 | container_name: dawarich_db |
| 23 | volumes: |
| 24 | - dawarich_db_data:/var/lib/postgresql/data |
| 25 | - dawarich_shared:/var/shared |
| 26 | # - ./postgresql.conf:/etc/postgresql/postgresql.conf # Optional, uncomment if you want to use a custom config |
| 27 | networks: |
| 28 | - dawarich |
| 29 | environment: |
| 30 | POSTGRES_USER: postgres |
| 31 | POSTGRES_PASSWORD: password |
| 32 | POSTGRES_DB: dawarich_development |
| 33 | restart: always |
| 34 | healthcheck: |
| 35 | test: [ "CMD-SHELL", "pg_isready -U postgres -d dawarich_development" ] |
| 36 | interval: 10s |
| 37 | retries: 5 |
| 38 | start_period: 30s |
| 39 | timeout: 10s |
| 40 | # command: postgres -c config_file=/etc/postgresql/postgresql.conf # Use custom config, uncomment if you want to use a custom config |
| 41 | dawarich_app: |
| 42 | image: freikin/dawarich:latest |
| 43 | container_name: dawarich_app |
| 44 | volumes: |
| 45 | - dawarich_public:/var/app/public |
| 46 | - dawarich_watched:/var/app/tmp/imports/watched |
| 47 | - dawarich_storage:/var/app/storage |
| 48 | - dawarich_db_data:/dawarich_db_data |
| 49 | networks: |
| 50 | - dawarich |
| 51 | ports: |
| 52 | - 3000:3000 |
| 53 | # - 9394:9394 # Prometheus exporter, uncomment if needed |
| 54 | stdin_open: true |
| 55 | tty: true |
| 56 | entrypoint: web-entrypoint.sh |
| 57 | command: ['bin/rails', 'server', '-p', '3000', '-b', '::'] |
| 58 | restart: on-failure |
| 59 | environment: |
| 60 | RAILS_ENV: development |
| 61 | REDIS_URL: redis://dawarich_redis:6379 |
| 62 | DATABASE_HOST: dawarich_db |
| 63 | DATABASE_USERNAME: postgres |
| 64 | DATABASE_PASSWORD: password |
| 65 | DATABASE_NAME: dawarich_development |
| 66 | MIN_MINUTES_SPENT_IN_CITY: 60 |
| 67 | APPLICATION_HOSTS: localhost |
| 68 | TIME_ZONE: Europe/London |
| 69 | APPLICATION_PROTOCOL: http |
| 70 | PROMETHEUS_EXPORTER_ENABLED: "false" |
| 71 | PROMETHEUS_EXPORTER_HOST: 0.0.0.0 |
| 72 | PROMETHEUS_EXPORTER_PORT: 9394 |
| 73 | SELF_HOSTED: "true" |
| 74 | STORE_GEODATA: "true" |
| 75 | logging: |
| 76 | driver: "json-file" |
| 77 | options: |
| 78 | max-size: "100m" |
| 79 | max-file: "5" |
| 80 | healthcheck: |
| 81 | test: [ "CMD-SHELL", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'" ] |
| 82 | interval: 10s |
| 83 | retries: 30 |
| 84 | start_period: 30s |
| 85 | timeout: 10s |
| 86 | depends_on: |
| 87 | dawarich_db: |
| 88 | condition: service_healthy |
| 89 | restart: true |
| 90 | dawarich_redis: |
| 91 | condition: service_healthy |
| 92 | restart: true |
| 93 | deploy: |
| 94 | resources: |
| 95 | limits: |
| 96 | cpus: '0.50' # Limit CPU usage to 50% of one core |
| 97 | memory: '4G' # Limit memory usage to 4GB |
| 98 | dawarich_sidekiq: |
| 99 | image: freikin/dawarich:latest |
| 100 | container_name: dawarich_sidekiq |
| 101 | volumes: |
| 102 | - dawarich_public:/var/app/public |
| 103 | - dawarich_watched:/var/app/tmp/imports/watched |
| 104 | - dawarich_storage:/var/app/storage |
| 105 | networks: |
| 106 | - dawarich |
| 107 | stdin_open: true |
| 108 | tty: true |
| 109 | entrypoint: sidekiq-entrypoint.sh |
| 110 | command: ['sidekiq'] |
| 111 | restart: on-failure |
| 112 | environment: |
| 113 | RAILS_ENV: development |
| 114 | REDIS_URL: redis://dawarich_redis:6379 |
| 115 | DATABASE_HOST: dawarich_db |
| 116 | DATABASE_USERNAME: postgres |
| 117 | DATABASE_PASSWORD: password |
| 118 | DATABASE_NAME: dawarich_development |
| 119 | APPLICATION_HOSTS: localhost |
| 120 | BACKGROUND_PROCESSING_CONCURRENCY: 10 |
| 121 | APPLICATION_PROTOCOL: http |
| 122 | PROMETHEUS_EXPORTER_ENABLED: "false" |
| 123 | PROMETHEUS_EXPORTER_HOST: dawarich_app |
| 124 | PROMETHEUS_EXPORTER_PORT: 9394 |
| 125 | SELF_HOSTED: "true" |
| 126 | STORE_GEODATA: "true" |
| 127 | logging: |
| 128 | driver: "json-file" |
| 129 | options: |
| 130 | max-size: "100m" |
| 131 | max-file: "5" |
| 132 | healthcheck: |
| 133 | test: [ "CMD-SHELL", "pgrep -f sidekiq" ] |
| 134 | interval: 10s |
| 135 | retries: 30 |
| 136 | start_period: 30s |
| 137 | timeout: 10s |
| 138 | depends_on: |
| 139 | dawarich_db: |
| 140 | condition: service_healthy |
| 141 | restart: true |
| 142 | dawarich_redis: |
| 143 | condition: service_healthy |
| 144 | restart: true |
| 145 | dawarich_app: |
| 146 | condition: service_healthy |
| 147 | restart: true |
| 148 | |
| 149 | volumes: |
| 150 | dawarich_db_data: |
| 151 | dawarich_shared: |
| 152 | dawarich_public: |
| 153 | dawarich_watched: |
| 154 | dawarich_storage: |