fix(dev): DB dans le compose (plus de dependance reseau Coolify)
Coolify prefixe les reseaux externes avec l UUID du projet, donc external: true, name: coolify ne fonctionne pas pour les services sans labels Traefik. Solution : integrer la DB directement dans le compose sur bm_internal. - Service db: postgis/postgis:16-3.4, volume bm_dev_db_data - Tous les DATABASE_URL passent par postgres://bm:@db:5432/bm - depends_on db (condition: service_healthy) sur tous les consumers - crawler, geocoder, flaresolverr: plus de reseau coolify (inutile) - La DB Coolify standalone n9dttfjalj5trqsg3o8twduo peut etre arretee Env vars requises dans Coolify UI: POSTGRES_PASSWORD, BM_IMPORT_TOKEN, PGADMIN_EMAIL, PGADMIN_PASSWORD, NOMINATIM_EMAIL, NOMINATIM_USER_AGENT Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ac7004ca4c
commit
bc06910708
1 changed files with 34 additions and 6 deletions
|
|
@ -1,4 +1,21 @@
|
||||||
services:
|
services:
|
||||||
|
db:
|
||||||
|
image: postgis/postgis:16-3.4
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: bm
|
||||||
|
POSTGRES_USER: bm
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- bm_dev_db_data:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- bm_internal
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U bm -d bm"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
command: ["redis-server", "--appendonly", "yes"]
|
command: ["redis-server", "--appendonly", "yes"]
|
||||||
|
|
@ -20,16 +37,18 @@ services:
|
||||||
build:
|
build:
|
||||||
context: apps/crawler
|
context: apps/crawler
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: ${DATABASE_URL}
|
DATABASE_URL: postgres://bm:${POSTGRES_PASSWORD}@db:5432/bm
|
||||||
FLARESOLVERR_URL: http://flaresolverr:8191
|
FLARESOLVERR_URL: http://flaresolverr:8191
|
||||||
CRAWLER_SCHED_INCREMENTAL_H: "4"
|
CRAWLER_SCHED_INCREMENTAL_H: "4"
|
||||||
CRAWLER_SCHED_ENRICH_H: "2"
|
CRAWLER_SCHED_ENRICH_H: "2"
|
||||||
CRAWLER_SCHED_FULL_DAY: "0"
|
CRAWLER_SCHED_FULL_DAY: "0"
|
||||||
depends_on:
|
depends_on:
|
||||||
- flaresolverr
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
flaresolverr:
|
||||||
|
condition: service_started
|
||||||
networks:
|
networks:
|
||||||
- bm_internal
|
- bm_internal
|
||||||
- coolify
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
geocoder-worker:
|
geocoder-worker:
|
||||||
|
|
@ -37,7 +56,7 @@ services:
|
||||||
context: apps/geocoder
|
context: apps/geocoder
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: ${DATABASE_URL}
|
DATABASE_URL: postgres://bm:${POSTGRES_PASSWORD}@db:5432/bm
|
||||||
NOMINATIM_BASE: "https://nominatim.openstreetmap.org"
|
NOMINATIM_BASE: "https://nominatim.openstreetmap.org"
|
||||||
NOMINATIM_EMAIL: ${NOMINATIM_EMAIL}
|
NOMINATIM_EMAIL: ${NOMINATIM_EMAIL}
|
||||||
NOMINATIM_USER_AGENT: ${NOMINATIM_USER_AGENT}
|
NOMINATIM_USER_AGENT: ${NOMINATIM_USER_AGENT}
|
||||||
|
|
@ -45,9 +64,11 @@ services:
|
||||||
NOMINATIM_JITTER: "0.35"
|
NOMINATIM_JITTER: "0.35"
|
||||||
GEOCODE_MAX_PER_RUN: "5000"
|
GEOCODE_MAX_PER_RUN: "5000"
|
||||||
command: ["python", "src/worker.py"]
|
command: ["python", "src/worker.py"]
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- bm_internal
|
- bm_internal
|
||||||
- coolify
|
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
||||||
pgadmin:
|
pgadmin:
|
||||||
|
|
@ -58,6 +79,9 @@ services:
|
||||||
PGADMIN_CONFIG_SERVER_MODE: "True"
|
PGADMIN_CONFIG_SERVER_MODE: "True"
|
||||||
volumes:
|
volumes:
|
||||||
- bm_dev_pgadmin_data:/var/lib/pgadmin
|
- bm_dev_pgadmin_data:/var/lib/pgadmin
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- bm_internal
|
- bm_internal
|
||||||
- coolify
|
- coolify
|
||||||
|
|
@ -75,9 +99,12 @@ services:
|
||||||
context: apps/api
|
context: apps/api
|
||||||
environment:
|
environment:
|
||||||
PORT: "3000"
|
PORT: "3000"
|
||||||
DATABASE_URL: ${DATABASE_URL}
|
DATABASE_URL: postgres://bm:${POSTGRES_PASSWORD}@db:5432/bm
|
||||||
BM_IMPORT_TOKEN: ${BM_IMPORT_TOKEN}
|
BM_IMPORT_TOKEN: ${BM_IMPORT_TOKEN}
|
||||||
CORS_ORIGINS: https://dev.metalfrom.eu
|
CORS_ORIGINS: https://dev.metalfrom.eu
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- bm_internal
|
- bm_internal
|
||||||
- coolify
|
- coolify
|
||||||
|
|
@ -114,5 +141,6 @@ networks:
|
||||||
name: coolify
|
name: coolify
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
bm_dev_db_data:
|
||||||
bm_dev_redis_data:
|
bm_dev_redis_data:
|
||||||
bm_dev_pgadmin_data:
|
bm_dev_pgadmin_data:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue