forked from benarch/Azure-IPAM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (106 loc) · 3.53 KB
/
Copy pathdocker-compose.yml
File metadata and controls
111 lines (106 loc) · 3.53 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
# =============================================================================
# Azure IPAM - Docker Compose Production Deployment
# =============================================================================
#
# Usage:
# 1. Copy .env.example to .env and configure your Azure credentials
# 2. Build: docker-compose build
# 3. Run: docker-compose up -d
# 4. Access: http://localhost:8080
#
# =============================================================================
services:
# -------------------------------------------------------------------------
# Azure Functions API
# -------------------------------------------------------------------------
api:
build:
context: ../..
dockerfile: deploy/docker/Dockerfile.api
container_name: azure-ipam-api
restart: unless-stopped
ports:
- "7071:7071"
environment:
# Azure Authentication (Service Principal)
- AZURE_TENANT_ID=${AZURE_TENANT_ID}
- AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
- AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
# Optional: Filter to specific subscriptions
- AZURE_SUBSCRIPTION_IDS=${AZURE_SUBSCRIPTION_IDS:-}
# Azure Functions settings
- AzureWebJobsStorage=${AZURE_STORAGE_CONNECTION:-UseDevelopmentStorage=true}
- FUNCTIONS_WORKER_RUNTIME=node
networks:
- ipam-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7071/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# -------------------------------------------------------------------------
# React Frontend (served via Nginx)
# -------------------------------------------------------------------------
frontend:
build:
context: ../..
dockerfile: deploy/docker/Dockerfile.frontend
args:
- VITE_AZURE_TENANT_ID=${VITE_AZURE_TENANT_ID}
- VITE_AZURE_CLIENT_ID=${VITE_AZURE_CLIENT_ID}
- VITE_API_BASE_URL=/api
container_name: azure-ipam-frontend
restart: unless-stopped
ports:
- "8080:8080"
environment:
# Runtime configuration (injected at startup)
- VITE_AZURE_TENANT_ID=${VITE_AZURE_TENANT_ID}
- VITE_AZURE_CLIENT_ID=${VITE_AZURE_CLIENT_ID}
- VITE_API_BASE_URL=/api
- API_URL=http://api:7071/api
depends_on:
api:
condition: service_healthy
networks:
- ipam-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# -------------------------------------------------------------------------
# Azurite (Azure Storage Emulator) - Optional for local development
# -------------------------------------------------------------------------
azurite:
image: mcr.microsoft.com/azure-storage/azurite:latest
container_name: azure-ipam-azurite
restart: unless-stopped
ports:
- "10000:10000" # Blob
- "10001:10001" # Queue
- "10002:10002" # Table
volumes:
- azurite-data:/data
command: "azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 -l /data --debug /data/debug.log"
networks:
- ipam-network
profiles:
- local # Only start with: docker-compose --profile local up
networks:
ipam-network:
driver: bridge
volumes:
azurite-data: