| 1 |
version: '3.8' |
| 2 |
|
| 3 |
services: |
| 4 |
# Frontend (Vue.js + nginx) |
| 5 |
web-client: |
| 6 |
build: |
| 7 |
context: ./client |
| 8 |
dockerfile: Dockerfile |
| 9 |
ports: |
| 10 |
- "80:8080" |
| 11 |
environment: |
| 12 |
- NODE_ENV=production |
| 13 |
depends_on: |
| 14 |
- web-server |
| 15 |
networks: |
| 16 |
- zephyrfs |
| 17 |
restart: unless-stopped |
| 18 |
healthcheck: |
| 19 |
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"] |
| 20 |
interval: 30s |
| 21 |
timeout: 10s |
| 22 |
retries: 3 |
| 23 |
start_period: 40s |
| 24 |
|
| 25 |
# Backend API server |
| 26 |
web-server: |
| 27 |
build: |
| 28 |
context: ./server |
| 29 |
dockerfile: Dockerfile |
| 30 |
ports: |
| 31 |
- "3000:3000" |
| 32 |
environment: |
| 33 |
- NODE_ENV=production |
| 34 |
- ZEPHYRFS_NODE_URL=http://zephyrfs-node:8080 |
| 35 |
- JWT_SECRET=${JWT_SECRET:-change-this-in-production-min-32-chars-long} |
| 36 |
- LOG_LEVEL=info |
| 37 |
- CORS_ORIGINS=http://localhost |
| 38 |
volumes: |
| 39 |
- web-logs:/app/logs |
| 40 |
depends_on: |
| 41 |
- zephyrfs-node |
| 42 |
networks: |
| 43 |
- zephyrfs |
| 44 |
restart: unless-stopped |
| 45 |
healthcheck: |
| 46 |
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"] |
| 47 |
interval: 30s |
| 48 |
timeout: 10s |
| 49 |
retries: 3 |
| 50 |
start_period: 40s |
| 51 |
|
| 52 |
# ZephyrFS core node |
| 53 |
zephyrfs-node: |
| 54 |
image: zephyrfs-node:latest |
| 55 |
ports: |
| 56 |
- "8080:8080" |
| 57 |
volumes: |
| 58 |
- zephyrfs-data:/data |
| 59 |
- node-logs:/logs |
| 60 |
environment: |
| 61 |
- RUST_LOG=info |
| 62 |
- ZEPHYRFS_DATA_DIR=/data |
| 63 |
networks: |
| 64 |
- zephyrfs |
| 65 |
restart: unless-stopped |
| 66 |
healthcheck: |
| 67 |
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] |
| 68 |
interval: 30s |
| 69 |
timeout: 10s |
| 70 |
retries: 3 |
| 71 |
start_period: 60s |
| 72 |
|
| 73 |
# Reverse proxy with TLS termination |
| 74 |
nginx-proxy: |
| 75 |
image: nginx:alpine |
| 76 |
ports: |
| 77 |
- "443:443" |
| 78 |
- "80:80" |
| 79 |
volumes: |
| 80 |
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro |
| 81 |
- ./nginx/ssl:/etc/nginx/ssl:ro |
| 82 |
- nginx-logs:/var/log/nginx |
| 83 |
depends_on: |
| 84 |
- web-client |
| 85 |
networks: |
| 86 |
- zephyrfs |
| 87 |
restart: unless-stopped |
| 88 |
healthcheck: |
| 89 |
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/health"] |
| 90 |
interval: 30s |
| 91 |
timeout: 10s |
| 92 |
retries: 3 |
| 93 |
|
| 94 |
volumes: |
| 95 |
zephyrfs-data: |
| 96 |
driver: local |
| 97 |
web-logs: |
| 98 |
driver: local |
| 99 |
node-logs: |
| 100 |
driver: local |
| 101 |
nginx-logs: |
| 102 |
driver: local |
| 103 |
|
| 104 |
networks: |
| 105 |
zephyrfs: |
| 106 |
driver: bridge |
| 107 |
ipam: |
| 108 |
config: |
| 109 |
- subnet: 172.20.0.0/16 |