Skip to content

Instantly share code, notes, and snippets.

@frostming
Last active October 13, 2023 03:33
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save frostming/05f41d3e35bf798fd224bc23fc07fcd6 to your computer and use it in GitHub Desktop.
Save frostming/05f41d3e35bf798fd224bc23fc07fcd6 to your computer and use it in GitHub Desktop.
A Fly.io config file for OpenCat™ for Team that can be deployed directly
# fly.toml file generated for still-snowflake-6351 on 2023-03-30T09:53:40+08:00
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "sin"
processes = []
[build]
image = "bayedev/opencatd"
[mount]
source = "opencat"
destination = "/opt/db"
[experimental]
auto_rollback = true
[[services]]
internal_port = 80
protocol = "tcp"
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
@frostming
Copy link
Author

frostming commented Mar 30, 2023

Usage

  1. Install flyctl
  2. Create an account with fly auth signup or login with fly auth login.
  3. mkdir myopencat && cd myopencat
  4. Copy the file content to fly.toml
  5. fly launch --copy-config
  6. fly vol create opencat --size 1
  7. fly deploy

@woyin
Copy link

woyin commented Mar 30, 2023

When I was on the 6th step, I got Error Could not find App "OpenCat Team"

@frostming
Copy link
Author

@woyin Thanks, updated the steps.

@huwan
Copy link

huwan commented Mar 30, 2023

Thank you for sharing the deployment configuration files and steps, it has been successfully launched. In step 6, by default, a persistent volume storage of 3GB is created, but in reality, it is not necessary to use so much, so I added the --size 1 option to create a persistent volume of only 1GB. fly.io provides 3GB persistent volume storage (total) for free. I made this change to avoid exceeding the limit when deploying other apps.

@yunkuaiji
Copy link

我到第7步出错,大概是image没找着,出错详细信息如下,请教如何解决?
==> Verifying app config
Validating /app/bin/myopencat/fly.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
Remote builder fly-builder-wispy-hill-8025 ready
Error failed to fetch an image or build from source: app does not have a Dockerfile or buildpacks configured. See https://fly.io/docs/reference/configuration/#the-build-section

@huwan
Copy link

huwan commented Apr 1, 2023

You may try flyctl doctor and LOG_LEVEL=debug fly deploy to help pinpoint the problem.

@yunkuaiji
Copy link

问题解决了,谢 谢 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment