https://github.com/zeropsio/recipe-go
https://github.com/zeropsio/recipe-go
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zeropsio/recipe-go
- Owner: zeropsio
- License: mit
- Created: 2024-06-11T06:43:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-10-24T07:57:05.000Z (8 months ago)
- Last Synced: 2025-12-23T05:50:34.079Z (6 months ago)
- Language: Go
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zerops x GO
This is the most bare-bones example of Go app running on [Zerops](https://zerops.io) — as few libraries as possible, just a simple endpoint with connnect, read and write to a Zerops PostgreSQL database.

## Deploy on Zerops
You can either click the deploy button to deploy directly on Zerops, or manually copy the [import yaml](https://github.com/zeropsio/recipe-go/blob/main/zerops-project-import.yml) to the import dialog in the Zerops app.
[](https://app.zerops.io/recipe/go)
## Recipe features
- **Golang v1.22.** on a load balanced **Zerops Go** service
- Zerops **PostgreSQL 16** service as database
- Healthcheck setup example
- Utilization of Zerops' built-in **environment variables** system
- Utilization of Zerops' built-in **log management**
## Production vs. development
Base of the recipe is ready for production, the difference comes down to:
- Use highly available version of the PostgreSQL database (change `mode` from `NON_HA` to `HA` in recipe YAML, `db` service section)
- Use at least two containers for the GO service to achieve high reliability and resilience (add `minContainers: 2` in recipe YAML, `api` service section)
Further things to think about when running more complex, highly available GO production apps on Zerops:
- Containers are volatile - use Zerops object storage to store your files
- Use Zerops Redis (KeyDB) for caching, storing sessions and pub/sub messaging
- Use more advanced logging lib, such as [Logrus](https://github.com/sirupsen/logrus), [Zap](https://github.com/uber-go/zap) or [ZeroLog](https://github.com/rs/zerolog)
Need help setting your project up? Join [Zerops Discord community](https://discord.com/invite/WDvCZ54).