Files
TieMeasureFlow/docker-compose.dev.yml
Adriano 192d4b590c Camera di stazione: acquisizione dal frontend e campi admin (#72)
Route POST /measure/api/vision/grab (proxy verso il servizio camera),
get_station_by_code, pulsante «Acquisisci dalla camera», grab() in
vision_execute.js, campi camera_url e camera_source nell'admin stazioni,
traduzioni it/en, extra_hosts host.docker.internal nel compose di sviluppo.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 09:51:07 +02:00

135 lines
3.6 KiB
YAML

services:
mysql:
image: mysql:8.0
container_name: tmflow-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root_password_change_me}
MYSQL_DATABASE: ${DB_NAME:-tiemeasureflow}
MYSQL_USER: ${DB_USER:-tmflow}
MYSQL_PASSWORD: ${DB_PASSWORD:-change_me_in_production}
volumes:
- mysql_data:/var/lib/mysql
command: >
--authentication-policy=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
--default-time-zone=+00:00
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
networks:
- tmflow-net
server:
build:
context: .
dockerfile: Dockerfile
container_name: tmflow-server
restart: unless-stopped
env_file:
- .env
environment:
APP_ENV: dev
DB_HOST: mysql
UPLOAD_DIR: uploads
VISION_WORKER_URL: http://vision:8100
WEB_CONCURRENCY: ${WEB_CONCURRENCY:-4}
TRUSTED_PROXY_COUNT: ${TRUSTED_PROXY_COUNT:-1}
volumes:
- upload_data:/app/uploads
depends_on:
mysql:
condition: service_healthy
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
networks:
- tmflow-net
vision:
build:
context: .
dockerfile: Dockerfile.vision
args:
VISION_ENGINE_VERSION: ${VISION_ENGINE_VERSION:-}
container_name: tmflow-vision
restart: unless-stopped
volumes:
- upload_data:/app/uploads:ro
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8100/health', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
networks:
- tmflow-net
client:
build:
context: .
dockerfile: Dockerfile.frontend
args:
# Commit nel piede di pagina (#70); facoltativo, vuoto = solo versione
APP_COMMIT: ${APP_COMMIT:-}
container_name: tmflow-client
restart: unless-stopped
env_file:
- .env
environment:
API_SERVER_URL: http://server:8000
# Nginx qui non termina SSL (vedi nginx/nginx.conf): un'installazione
# on-premise su LAN in HTTP semplice ha bisogno del cookie non-secure,
# altrimenti il browser non lo rimanda mai indietro.
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-false}
# #72: da container si raggiunge il servizio camera (vs-gui) sull'host Linux
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
server:
condition: service_healthy
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/auth/login', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
networks:
- tmflow-net
nginx:
image: nginx:alpine
container_name: tmflow-nginx
restart: unless-stopped
ports:
- "${NGINX_PORT:-80}:80"
- "${NGINX_SSL_PORT:-443}:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
# Uncomment for SSL:
# - ./certbot/conf:/etc/letsencrypt:ro
# - ./certbot/www:/var/www/certbot:ro
depends_on:
server:
condition: service_healthy
client:
condition: service_healthy
networks:
- tmflow-net
volumes:
mysql_data:
driver: local
upload_data:
driver: local
networks:
tmflow-net:
driver: bridge