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
This commit is contained in:
@@ -84,6 +84,62 @@ services:
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user