Files
FarmaFinder/docker-compose.yml
T
Antoni Nuñez Romeu b34657c78f feat: add parapharmacy API with MongoDB and N8N setup
- Create parapharmacy-api microservice with Express + Swagger + MongoDB
- Add product model with full-text search and deduplication
- Add CRUD endpoints and bulk upsert for scrapers
- Update docker-compose.yml with MongoDB, N8N, and parapharmacy-api services
- Add proxy endpoints in FarmaFinder backend for parapharmacy
- Update frontend services to use parapharmacy API
- Add Swagger documentation at /api/docs
2026-07-16 12:26:54 +02:00

146 lines
4.0 KiB
YAML

services:
redis:
image: redis:alpine
restart: unless-stopped
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: farmafinder
POSTGRES_USER: farmafinder
POSTGRES_PASSWORD: ${PG_PASSWORD:-change-me-in-production}
volumes:
- postgres_data:/var/lib/postgresql/data
backend:
image: git.hacecalor.net/ichitux/farmafinder-backend:latest
build:
context: .
dockerfile: apps/backend/Dockerfile
restart: unless-stopped
env_file:
- ./apps/backend/.env
ports:
- "3001:3001"
environment:
PORT: "3001"
NODE_ENV: production
SESSION_SECRET: ${SESSION_SECRET:-change-me-in-production}
CORS_ORIGIN: http://localhost:4000
REDIS_HOST: redis
REDIS_PORT: "6379"
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
DATABASE_PATH: /app/data/database.sqlite
FARMACIAS_WEBHOOK_URL: ${FARMACIAS_WEBHOOK_URL:-}
PG_URL: postgresql://farmafinder:${PG_PASSWORD:-change-me-in-production}@postgres:5432/farmafinder
# OpenTelemetry — exported via OTLP gRPC to the shared Alloy collector
OTEL_SERVICE_NAME: farmafinder-backend
OTEL_EXPORTER_OTLP_ENDPOINT: http://host.docker.internal:4317
OTEL_TRACES_EXPORTER: otlp
OTEL_METRICS_EXPORTER: otlp
OTEL_LOGS_EXPORTER: otlp
OTEL_RESOURCE_ATTRIBUTES: service.namespace=farmafinder
volumes:
- backend_data:/app/data
depends_on:
- redis
- postgres
frontend:
image: git.hacecalor.net/ichitux/farmafinder-frontend:latest
build:
context: ./apps/frontend
args:
VITE_FARO_ENDPOINT: ${VITE_FARO_ENDPOINT:-http://localhost:4318}
VITE_FARO_APP_NAME: ${VITE_FARO_APP_NAME:-farmafinder-frontend}
VITE_FARO_ENV: ${VITE_FARO_ENV:-production}
VITE_FARO_APP_VERSION: ${VITE_FARO_APP_VERSION:-1.0.0}
restart: unless-stopped
ports:
- "4000:80"
depends_on:
- backend
# --- Observability exporters (scraped by the shared Prometheus on srv84-macos) ---
redis-exporter:
image: oliver006/redis_exporter:latest
restart: unless-stopped
ports:
- "9121:9121"
environment:
REDIS_ADDR: redis://redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
depends_on:
- redis
postgres-exporter:
image: prometheuscommunity/postgres-exporter:latest
restart: unless-stopped
ports:
- "9187:9187"
environment:
DATA_SOURCE_NAME: postgresql://farmafinder:${PG_PASSWORD:-change-me-in-production}@postgres:5432/farmafinder?sslmode=disable
depends_on:
- postgres
# --- Parapharmacy API ---
parapharmacy-api:
image: git.hacecalor.net/ichitux/farmafinder-parapharmacy-api:latest
build:
context: .
dockerfile: apps/parapharmacy-api/Dockerfile
restart: unless-stopped
ports:
- "3002:3002"
environment:
PORT: "3002"
NODE_ENV: production
MONGODB_URI: mongodb://mongodb:27017/parapharmacy
CORS_ORIGIN: http://localhost:4000
depends_on:
- mongodb
# --- MongoDB for Parapharmacy ---
mongodb:
image: mongo:7
restart: unless-stopped
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
# --- N8N Workflow Automation ---
n8n:
image: n8nio/n8n:latest
restart: unless-stopped
ports:
- "5678:5678"
environment:
N8N_BASIC_AUTH_ACTIVE: "true"
N8N_BASIC_AUTH_USER: ${N8N_USER:-admin}
N8N_BASIC_AUTH_PASSWORD: ${N8N_PASSWORD:-change-me}
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_DATABASE: farmafinder
DB_POSTGRESDB_USER: farmafinder
DB_POSTGRESDB_PASSWORD: ${PG_PASSWORD:-change-me-in-production}
N8N_HOST: localhost
N8N_PORT: 5678
N8N_PROTOCOL: http
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
# --- Parapharmacy Backend connection ---
backend:
environment:
PARAPHARMACY_API_URL: http://parapharmacy-api:3002
volumes:
backend_data:
postgres_data:
mongodb_data:
n8n_data: