https://github.com/sarumaj/restartable-server
Implementation of a HTTP server resilient to SIGTERM OS signal and restartable on demand.
https://github.com/sarumaj/restartable-server
failsafe go golang http-server
Last synced: 8 months ago
JSON representation
Implementation of a HTTP server resilient to SIGTERM OS signal and restartable on demand.
- Host: GitHub
- URL: https://github.com/sarumaj/restartable-server
- Owner: sarumaj
- License: mit
- Created: 2023-10-09T06:02:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T16:59:39.000Z (almost 2 years ago)
- Last Synced: 2025-01-30T09:18:13.580Z (over 1 year ago)
- Topics: failsafe, go, golang, http-server
- Language: Go
- Homepage: https://sarumaj.github.io/restartable-server/
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/sarumaj/restartable-server/actions/workflows/deploy.yml)
[](https://goreportcard.com/report/github.com/sarumaj/restartable-server)
[](https://codeclimate.com/github/sarumaj/restartable-server/maintainability)
[](https://pkg.go.dev/github.com/sarumaj/restartable-server)
[](https://go.dev)
---
# restartable-server
Implementation of a HTTP server resilient to SIGTERM OS signal and restartable on demand.
Especially interesting when deploying HTTP servers with the GO runtime in containers.
Container runtime engine usually send a SIGTERM signal to kill the server process,
which can be catch by the restartable server to restart itself.
Provided as Proof of Concepts. Currently available at [restartable-server.heroku.com](https://restartable-server-a78d4e6a2c84.herokuapp.com/).
https://github.com/sarumaj/restartable-server/assets/71898979/b511aa0e-707c-4260-a8b0-b3179a165e7e
## Local deployment
```
go build -o server cmd/server/main.go
./server
```
## Deployment on Heroku
```
heroku login
docker ps
heroku container:login
heroku container:push web -a
heroku container:release web -a
```