- API Express/pg connectée à PostgreSQL (converti depuis mssql) - 8 routes : articles, fournisseurs, commandes, stock, mouvements, performance, schema, sync - Service sync nightly (mssql → pg, cron 3h00) - Docker Compose : postgres + api + sync + frpc (tunnel sortant) - Schéma PostgreSQL 17 tables dans postgres/init.sql Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
services:
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: ff_postgres
|
|
environment:
|
|
POSTGRES_DB: ${PG_DB}
|
|
POSTGRES_USER: ${PG_USER}
|
|
POSTGRES_PASSWORD: ${PG_PASSWORD}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${PG_USER} -d ${PG_DB}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
api:
|
|
build: .
|
|
container_name: ff_api
|
|
environment:
|
|
PG_HOST: postgres
|
|
PG_PORT: 5432
|
|
PG_DB: ${PG_DB}
|
|
PG_USER: ${PG_USER}
|
|
PG_PASSWORD: ${PG_PASSWORD}
|
|
API_PORT: ${API_PORT:-3000}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
sync:
|
|
build: ./sync
|
|
container_name: ff_sync
|
|
environment:
|
|
DB_HOST: ${DB_HOST}
|
|
DB_PORT: ${DB_PORT:-1433}
|
|
DB_NAME: ${DB_NAME}
|
|
DB_USER: ${DB_USER}
|
|
DB_PASSWORD: ${DB_PASSWORD}
|
|
PG_HOST: postgres
|
|
PG_PORT: 5432
|
|
PG_DB: ${PG_DB}
|
|
PG_USER: ${PG_USER}
|
|
PG_PASSWORD: ${PG_PASSWORD}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
# Tunnel sortant vers le serveur Hostinger (aucun port entrant requis)
|
|
frpc:
|
|
image: snowdreamtech/frpc:latest
|
|
container_name: ff_frpc
|
|
volumes:
|
|
- ./frpc.toml:/etc/frp/frpc.toml:ro
|
|
depends_on:
|
|
- api
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|