-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
184 lines (171 loc) · 6.4 KB
/
Copy pathdocker-compose.yml
File metadata and controls
184 lines (171 loc) · 6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# =============================================================================
# FlowyML Docker Compose - Local Development Stack
# =============================================================================
# This file defines the complete local development environment for FlowyML.
#
# Usage:
# make local-deploy # Start all services
# make local-stop # Stop all services
# make docker-build # Rebuild images
#
# Services:
# - postgres: PostgreSQL 15 database
# - backend: FlowyML API server (port 8080)
# - frontend: FlowyML Web UI (port 80)
# - prometheus: Metrics collection (port 9090)
# - grafana: Dashboards (port 3001)
# =============================================================================
services:
# ---------------------------------------------------------------------------
# PostgreSQL Database
# ---------------------------------------------------------------------------
postgres:
image: postgres:15-alpine
container_name: flowyml-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-flowyml}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-flowyml_secure_password}
POSTGRES_DB: ${POSTGRES_DB:-flowyml}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- flowyml-network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-flowyml} -d ${POSTGRES_DB:-flowyml}" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
# ---------------------------------------------------------------------------
# FlowyML Backend API
# ---------------------------------------------------------------------------
backend:
build:
context: .
dockerfile: Dockerfile
image: flowyml:latest
container_name: flowyml-app
ports:
- "${FLOWYML_PORT:-8080}:8080"
environment:
# Database Configuration
FLOWYML_DATABASE_URL: ${FLOWYML_DATABASE_URL:-postgresql://flowyml:flowyml_secure_password@postgres:5432/flowyml}
# Storage Configuration
FLOWYML_METADATA_DB: ${FLOWYML_METADATA_DB:-/app/data/metadata.db}
FLOWYML_ARTIFACTS_DIR: ${FLOWYML_ARTIFACTS_DIR:-/app/artifacts}
# Server URLs (for client configuration)
FLOWYML_REMOTE_SERVER_URL: ${FLOWYML_REMOTE_SERVER_URL:-http://localhost:8080}
FLOWYML_REMOTE_UI_URL: ${FLOWYML_REMOTE_UI_URL:-http://localhost:8080}
# Authentication
#
# With FLOWYML_ENV=production the server refuses to start unless both
# FLOWYML_API_TOKEN and FLOWYML_ADMIN_PASSWORD are set. Without them
# every endpoint - including POST /api/execution/execute, which imports
# and runs arbitrary Python modules - would be reachable unauthenticated.
# Set FLOWYML_ALLOW_INSECURE=1 only if a proxy in front of FlowyML
# already enforces authentication.
FLOWYML_AUTH_SECRET: ${FLOWYML_AUTH_SECRET:-change-this-secret-in-production}
FLOWYML_API_TOKEN: ${FLOWYML_API_TOKEN:-}
FLOWYML_ADMIN_USER: ${FLOWYML_ADMIN_USER:-admin}
FLOWYML_ADMIN_PASSWORD: ${FLOWYML_ADMIN_PASSWORD:-}
FLOWYML_ALLOW_INSECURE: ${FLOWYML_ALLOW_INSECURE:-}
# Browser origins allowed to call the API (comma-separated).
FLOWYML_CORS_ORIGINS: ${FLOWYML_CORS_ORIGINS:-}
# Environment
FLOWYML_ENV: ${FLOWYML_ENV:-development}
# Logging
LOG_LEVEL: ${LOG_LEVEL:-INFO}
volumes:
- flowyml_data:/app/data
- flowyml_artifacts:/app/artifacts
depends_on:
postgres:
condition: service_healthy
networks:
- flowyml-network
restart: unless-stopped
# ---------------------------------------------------------------------------
# Prometheus - Metrics Collection
# ---------------------------------------------------------------------------
prometheus:
image: prom/prometheus:v2.48.0
container_name: flowyml-prometheus
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=15d'
- '--web.enable-lifecycle'
networks:
- flowyml-network
restart: unless-stopped
# ---------------------------------------------------------------------------
# cAdvisor - Container Metrics
# ---------------------------------------------------------------------------
cadvisor:
# Use zcube/cadvisor for better compatibility with Docker Desktop on Mac (ARM64/AMD64)
image: zcube/cadvisor:latest
container_name: flowyml-cadvisor
privileged: true
devices:
- /dev/kmsg
ports:
- "8085:8080"
volumes:
- /:/rootfs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
networks:
- flowyml-network
restart: unless-stopped
# ---------------------------------------------------------------------------
# Grafana - Dashboards & Visualization
# ---------------------------------------------------------------------------
grafana:
image: grafana/grafana:10.2.2
container_name: flowyml-grafana
ports:
- "${GRAFANA_PORT:-3001}:3000"
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
GF_SERVER_ROOT_URL: ${GRAFANA_ROOT_URL:-http://localhost:3001}
volumes:
- ./docker/grafana/provisioning:/etc/grafana/provisioning:ro
- ./docker/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
networks:
- flowyml-network
depends_on:
- prometheus
restart: unless-stopped
# -----------------------------------------------------------------------------
# Volumes
# -----------------------------------------------------------------------------
volumes:
postgres_data:
driver: local
flowyml_data:
driver: local
flowyml_artifacts:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
# -----------------------------------------------------------------------------
# Networks
# -----------------------------------------------------------------------------
networks:
flowyml-network:
driver: bridge