2024-12-09 06:21:41 -06:00
2024-12-09 06:21:41 -06:00
2024-12-03 04:03:43 -06:00
2024-12-04 07:27:29 -06:00

Flux

Flux is a lightweight self-hosted pseudo-PaaS for hosting Golang web apps with ease. Built on top of Buildpacks and Docker, Flux simplifies the deployment process with a focus on similicity, speed, and reliability.

Features

  • Blue-Green Deployments: Deploy new versions of your app without downtime
  • Simplify Deployment: Flux takes care of the deployment process, so you can focus on writing your app
  • Flexible Configuration: Easily configure your app with flux.json
  • Automatic Container Management: Steamline your app with automatic container management

Dependencies

Intallation

Daemon

To install and start the Flux daemon using ZQDGR, run the following command:

# method 1
zqdgr build:daemon
sudo ./fluxd

# method 2
FLUXD_ROOT_DIR=$PWD/fluxdd zqdgr run:daemon

CLI

Install the CLI using the following command:

go install github.com/juls0730/flux/cmd/flux@latest

Configuration

Daemon

Flux daemon looks for a confgiuration file in /var/fluxd/config.json but can be configured by setting $FLUXD_ROOT_DIR to the directory where you want all fluxd files to be stored.

{
  "builder": "paketobuildpacks/builder-jammy-tiny"
}
  • builder: The buildpack builder to use (default: paketobuildpacks/builder-jammy-tiny)

Daemon Settings

  • Default port: 5647 (Daemon server)
  • Reverse Proxy Port: 7465 (configurable via FLUXD_PROXY_PORT environment variable)

CLI

The CLI looks for a configuration file in ~/.config/flux/config.json:

{
  "daemon_url": "http://127.0.0.1:5647"
}
  • daemon_url: The URL of the daemon to connect to (default: http://127.0.0.1:5647)

Commands

Flux <command>

Available commands:

  • init: Initialize a new project
  • deploy: Deploy an application
  • start: Start an application
  • stop: Stop an application
  • delete: Delete an application
  • list: View application logs

Project Configuration (flux.json)

flux.json is the configuration file in the root of your proejct that defines deployment settings:

{
  "name": "my-app",
  "url": "myapp.example.com",
  "port": 8080,
  "env_file": ".env",
  "environment": ["DEBUG=true"]
}

Configuration Options

  • name: The name of the project
  • url: Domain for the application
  • port: Web server's listening port
  • env_file: Path to environment variable file
  • environment: Additional environment variables

Deployment Notes

  • After deploying an app, point your domain to the Flux reverse proxy
  • Ensure the Host header is sent with your requests

Contributing

Found a bug, or have something you think would make Flux better? Submit an issue or pull request.

License

Flux is licensed with the MIT license

Description
Flux is a lightweight self-hosted pseudo-paas for golang web apps.
Readme MIT 193 KiB
Languages
Go 99.3%
Dockerfile 0.7%