mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 08:57:54 +01:00
- Fix Listmonk/CMS users table conflict by using separate listmonk_db database - Fix migration errors: index column names, conditional index creation, seller_profiles missing columns, immutable function in unique index - Add staffVerificationCode and staffWelcome email templates for @revamp-it.ch - Update registerUser() to select template based on staff status - Add Listmonk service to docker-compose with Mailpit for local testing - Add email provider abstraction supporting both Listmonk and direct SMTP Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
207 lines
5.7 KiB
YAML
207 lines
5.7 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database (Unified - for CMS API, NextAuth, and all services)
|
|
# Using pgvector image for AI/RAG vector similarity search support
|
|
db:
|
|
container_name: revampit_db
|
|
image: pgvector/pgvector:pg15
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
POSTGRES_DB: ${DB_NAME:-revampit_cms}
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
|
|
volumes:
|
|
- revampit_db_data:/var/lib/postgresql/data
|
|
- ./postgres-init:/docker-entrypoint-initdb.d
|
|
ports:
|
|
- "${DB_PORT:-5433}:5432"
|
|
networks:
|
|
- revampit_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# PostgreSQL for Medusa (separate database)
|
|
medusa_db:
|
|
container_name: revampit_medusa_db
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${MEDUSA_DB_USER:-medusa}
|
|
POSTGRES_PASSWORD: ${MEDUSA_DB_PASSWORD:-medusa_password}
|
|
POSTGRES_DB: ${MEDUSA_DB_NAME:-medusa_db}
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
|
|
volumes:
|
|
- medusa_db_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "${MEDUSA_DB_PORT:-5435}:5432"
|
|
networks:
|
|
- medusa_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${MEDUSA_DB_USER:-medusa}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Redis/Valkey for Medusa
|
|
medusa_redis:
|
|
container_name: revampit_medusa_redis
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${MEDUSA_REDIS_PORT:-6380}:6379"
|
|
networks:
|
|
- medusa_network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Meilisearch for fast product search
|
|
meilisearch:
|
|
container_name: revampit_meilisearch
|
|
image: getmeili/meilisearch:v1.11
|
|
restart: unless-stopped
|
|
environment:
|
|
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-masterKey_change_in_production}
|
|
MEILI_ENV: development
|
|
MEILI_NO_ANALYTICS: "true"
|
|
volumes:
|
|
- meilisearch_data:/meili_data
|
|
ports:
|
|
- "${MEILI_PORT:-7700}:7700"
|
|
networks:
|
|
- medusa_network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:7700/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Medusa E-commerce Backend
|
|
medusa:
|
|
container_name: revampit_medusa
|
|
build:
|
|
context: ./medusa-backend
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
environment:
|
|
NODE_ENV: development
|
|
MEDUSA_ADMIN_ONBOARDING_TYPE: default
|
|
STORE_CORS: http://localhost:3000,http://localhost:3001,https://revampit.vercel.app
|
|
ADMIN_CORS: http://localhost:9000,http://localhost:7001
|
|
AUTH_CORS: http://localhost:9000,http://localhost:3000
|
|
REDIS_URL: redis://medusa_redis:6379
|
|
JWT_SECRET: ${MEDUSA_JWT_SECRET:-supersecret_change_in_production}
|
|
COOKIE_SECRET: ${MEDUSA_COOKIE_SECRET:-supersecret_change_in_production}
|
|
DATABASE_URL: postgresql://medusa:medusa_password@medusa_db:5432/medusa_db
|
|
ports:
|
|
- "9000:9000"
|
|
networks:
|
|
- medusa_network
|
|
depends_on:
|
|
medusa_db:
|
|
condition: service_healthy
|
|
medusa_redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:9000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
|
|
# CMS API Service (disabled by default; requires explicit approval)
|
|
# cms_api:
|
|
# build:
|
|
# context: ./cms-api
|
|
# dockerfile: Dockerfile
|
|
# container_name: revampit_cms_api
|
|
# restart: unless-stopped
|
|
# environment:
|
|
# NODE_ENV: production
|
|
# PORT: 3001
|
|
# DB_HOST: db
|
|
# DB_PORT: 5432
|
|
# DB_USER: ${DB_USER:-postgres}
|
|
# DB_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
# DB_NAME: ${DB_NAME:-revampit_cms}
|
|
# JWT_SECRET: ${JWT_SECRET:-dev-jwt-secret-min-32-chars-please-change}
|
|
# FRONTEND_URL: http://localhost:3000
|
|
# ports:
|
|
# - "${CMS_API_PORT:-3001}:3001"
|
|
# networks:
|
|
# - revampit_network
|
|
# depends_on:
|
|
# db:
|
|
# condition: service_healthy
|
|
# volumes:
|
|
# - ./cms-api/uploads:/app/uploads
|
|
# healthcheck:
|
|
# test: ["CMD", "curl", "-fsS", "http://localhost:3001/health"]
|
|
# interval: 30s
|
|
# timeout: 10s
|
|
# retries: 5
|
|
|
|
# Mailpit - Local email testing (catches all emails, sends nothing)
|
|
# Web UI: http://localhost:8025
|
|
# SMTP: localhost:1025
|
|
mailpit:
|
|
container_name: revampit_mailpit
|
|
image: axllent/mailpit:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8025:8025" # Web UI
|
|
- "1025:1025" # SMTP
|
|
networks:
|
|
- revampit_network
|
|
environment:
|
|
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
|
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
|
|
|
# Listmonk - Open Source Email & Newsletter Service
|
|
listmonk:
|
|
container_name: revampit_listmonk
|
|
image: listmonk/listmonk:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${LISTMONK_PORT:-9090}:9000"
|
|
environment:
|
|
- TZ=Europe/Zurich
|
|
volumes:
|
|
- ./listmonk/config.toml:/listmonk/config.toml
|
|
- listmonk_uploads:/listmonk/uploads
|
|
networks:
|
|
- revampit_network
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
command: ["./listmonk", "--config", "/listmonk/config.toml"]
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:9000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
|
|
volumes:
|
|
revampit_db_data:
|
|
driver: local
|
|
medusa_db_data:
|
|
driver: local
|
|
meilisearch_data:
|
|
driver: local
|
|
listmonk_uploads:
|
|
driver: local
|
|
|
|
networks:
|
|
revampit_network:
|
|
driver: bridge
|
|
name: revampit_network
|
|
medusa_network:
|
|
driver: bridge
|
|
name: medusa_network
|