Skip to content

Commit 80746ed

Browse files
committed
fix: update fly.toml configuration for Spring Boot deployment
- Fix health check path: /health -> /actuator/health - Change region from sjc (San Jose) to hkg (Hong Kong) for better latency - Add Dockerfile build configuration - Remove memory_mb conflict (keep memory = '1gb') - Maintain simplified fly.toml v2 format with http_service This configuration is generated by fly launch and optimized for production.
1 parent 1fc19b6 commit 80746ed

File tree

1 file changed

+26
-72
lines changed

1 file changed

+26
-72
lines changed

fly.toml

Lines changed: 26 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,35 @@
1-
# Fly.io configuration for HaloLight API Java
2-
# https://fly.io/docs/reference/configuration/
1+
# fly.toml app configuration file generated for halolight-api-java on 2025-12-09
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
35

4-
app = "halolight-api-java"
5-
primary_region = "hkg" # Hong Kong - change to your preferred region
6-
kill_signal = "SIGINT"
7-
kill_timeout = "5s"
6+
app = 'halolight-api-java'
7+
primary_region = 'hkg'
88

99
[build]
1010
dockerfile = "Dockerfile"
1111

1212
[env]
1313
PORT = "8080"
14-
# Secrets should be set via: fly secrets set KEY=VALUE
15-
# Required secrets:
16-
# - DATABASE_URL (format: jdbc:postgresql://host:port/dbname)
17-
# - DATABASE_USERNAME
18-
# - DATABASE_PASSWORD
19-
# - JWT_SECRET (minimum 256 bits)
20-
# Optional:
21-
# - SPRING_PROFILES_ACTIVE (default: prod)
22-
# - JWT_EXPIRATION (default: 86400000 - 24 hours)
23-
# - JWT_REFRESH_EXPIRATION (default: 604800000 - 7 days)
24-
# - CORS_ALLOWED_ORIGINS (comma-separated)
2514

26-
[deploy]
27-
strategy = "rolling" # Zero-downtime deployment
28-
29-
[checks]
30-
[checks.health]
31-
port = 8080
32-
type = "http"
33-
interval = "15s"
34-
timeout = "5s"
35-
grace_period = "30s"
36-
method = "GET"
37-
path = "/actuator/health"
38-
39-
[[services]]
15+
[http_service]
4016
internal_port = 8080
41-
protocol = "tcp"
42-
processes = ["app"]
43-
44-
[[services.ports]]
45-
port = 80
46-
handlers = ["http"]
47-
force_https = true # Redirect HTTP to HTTPS
48-
49-
[[services.ports]]
50-
port = 443
51-
handlers = ["tls", "http"]
52-
53-
[services.concurrency]
54-
type = "requests"
55-
soft_limit = 20
56-
hard_limit = 40
57-
58-
[[services.http_checks]]
59-
interval = "15s"
60-
grace_period = "30s"
61-
method = "GET"
62-
path = "/actuator/health"
63-
protocol = "http"
64-
timeout = "5s"
65-
tls_skip_verify = false
66-
67-
[metrics]
68-
port = 8080
69-
path = "/actuator/prometheus"
70-
71-
# VM Configuration
72-
[vm]
73-
size = "shared-cpu-1x" # 1 shared vCPU
74-
memory_mb = 1024 # 1024 MB RAM (increased for Spring Boot + JPA)
75-
76-
# Auto-scaling Configuration
77-
[machines]
78-
auto_start_machines = true # Auto-start machines when traffic arrives
79-
auto_stop_machines = true # Auto-stop machines when idle (cost optimization)
80-
min_machines_running = 2 # Set to 2 for true zero-downtime during deploys
81-
# max_machines_running = 5 # Uncomment to limit max instances
17+
force_https = true
18+
auto_stop_machines = 'suspend'
19+
auto_start_machines = true
20+
min_machines_running = 1
21+
processes = ['app']
22+
23+
# Health check configuration
24+
[http_service.checks]
25+
[http_service.checks.health]
26+
grace_period = "10s"
27+
interval = "30s"
28+
method = "GET"
29+
timeout = "5s"
30+
path = "/actuator/health"
31+
32+
[[vm]]
33+
memory = '1gb'
34+
cpu_kind = 'shared'
35+
cpus = 1

0 commit comments

Comments
 (0)