minor changes

This commit is contained in:
Bhavnoor Singh Saroya 2025-08-25 14:23:55 -07:00
parent 909b29dfb5
commit af2e220116
30 changed files with 598 additions and 350 deletions

View file

@ -7,21 +7,21 @@ app = 'deployment-service'
primary_region = 'sea'
[build]
dockerfile = 'Dockerfile'
dockerfile = 'Dockerfile'
[[services]]
protocol = 'tcp'
internal_port = 8080
auto_stop_machines = 'stop'
auto_start_machines = true
ports = []
protocol = 'tcp'
internal_port = 8080
auto_stop_machines = 'off'
auto_start_machines = true
ports = []
[services.concurrency]
type = 'requests'
hard_limit = 1000
soft_limit = 500
[services.concurrency]
type = 'requests'
hard_limit = 1000
soft_limit = 500
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

View file

@ -122,7 +122,7 @@ app.post("/deploy", async (req, res) => {
http_service: {
internal_port: 8000,
force_https: true,
auto_stop_machines: "stop",
auto_stop_machines: "suspend",
auto_start_machines: true,
min_machines_running: 0,
processes: ["app"],
@ -147,14 +147,14 @@ app.post("/deploy", async (req, res) => {
console.log("Machine config:", JSON.stringify(machineConfig, null, 2));
await fly.post(`/apps/${appName}/machines`, machineConfig);
console.log("Allocating IPv4 via GraphQL API");
const v4resp = await gqlClient.post("", {
query: ALLOCATE_IP_MUTATION,
variables: { input: { appId: appName, type: "v4" } },
});
const ipv4 = v4resp.data.data.allocateIpAddress.ipAddress.address;
console.log("Allocated IPv4:", ipv4);
// console.log("Allocating IPv4 via GraphQL API");
// const v4resp = await gqlClient.post("", {
// query: ALLOCATE_IP_MUTATION,
// variables: { input: { appId: appName, type: "v4" } },
// });
// const ipv4 = v4resp.data.data.allocateIpAddress.ipAddress.address;
// console.log("Allocated IPv4:", ipv4);
const ipv4 = "snake-byte.org"; // Placeholder for IPv4 allocation, if needed
console.log("Allocating IPv6 via GraphQL API");
const v6resp = await gqlClient.post("", {
query: ALLOCATE_IP_MUTATION,
@ -175,7 +175,7 @@ app.post("/deploy", async (req, res) => {
status: "created",
app: appName,
ipv4,
ipv6 : firstPrivateIp,
ipv6: firstPrivateIp,
url_v4: `http://${ipv4}`,
url_v6: `http://[${firstPrivateIp}]`,
});
@ -255,7 +255,7 @@ app.post("/:appName/delete", async (req, res) => {
const appCheck = await fly.get(`/apps/${appName}`);
console.log("App check response:", appCheck.status);
await fly.delete(`/apps/${appName}`);
return res.json({ status: "deleted", app: appName });