TwiN / gatus

⛑ Automated developer-oriented status page
https://gatus.io
Apache License 2.0
6.18k stars 414 forks source link

Struggling noob with docker #161

Closed luckman212 closed 3 years ago

luckman212 commented 3 years ago

Hi and please forgive me in advance if these are foolish questions.

I found Gatus and really want to set it up in my homelab. So, off I went, to install Ubuntu20 + Docker and fumble my way through getting the thing running. I guess the installation guide assumes a good working knowledge of docker, kubernetes, helm, etc. Guess I'll need to really study up on that.

Relevant xkcd: https://xkcd.com/1988/

Anyway, I figured out how to install the docker image such that it auto-starts on boot:

docker volume create gatus-storage

docker run -d --restart unless-stopped -p 8080:8080 --name=gatus -v gatus-storage:/var/lib/gatus twinproduction/gatus

The problem is, I also want to enable sqlite storage, and can't figure out how to do that. I saw the example at https://github.com/TwinProduction/gatus/tree/master/examples/docker-compose-sqlite-storage, and I figured I could copy the docker-compose.yml to e.g. /root/gatus/docker-compose.yml and then run docker-compose up to get it running (but not as a daemon). (Trying to figure out how to access the gatus-storage volume created above to edit the config.yaml contained within).

I tried this command, but it dies immediately:

# docker run -p 8080:8080 --mount type=bind,source=/root/gatus/config.yaml,target=/config/config.yaml --name gatus twinproduction/gatus
2021/08/23 00:37:59 [config][Load] Reading configuration from configFile=config/config.yaml
2021/08/23 00:37:59 [config][validateAlertingConfig] Alerting is not configured
2021/08/23 00:37:59 [config][validateServicesConfig] Validated 2 services
2021/08/23 00:37:59 [storage][Initialize] Creating storage provider with type=sqlite and file=/data/data.db
panic: unable to open database file: out of memory (14)

goroutine 1 [running]:
main.main()
    /app/main.go:19 +0x165

Is this supposed to be easier?

Another possibly unrelated issue is, I have a simple ICMP test, running at 10s intervals. The Average Response Time graph at the bottom does not seem to update, and also does not seem to correlate at all with the gathered data.

e.g. screenshot taken at 8:31pm... 🤷‍♂️ CleanShot 2021-08-23 at 08 41 50

Again, I'm sure most of this is just me being ignorant, and for that I apologize. Thank you for any guidance.

TwiN commented 3 years ago

Hello @luckman212,

Don't worry, there are no foolish questions :)

Regarding your question on using Gatus with SQLite storage, what happens if you clone gatus and docker-compose up from the examples/docker-compose-sqlite-storage folder? I suspect that due to not having a data folder where you copied the docker-compose.yml file, you're running into some issues.

git clone https://github.com/TwinProduction/gatus
cd gatus/examples/docker-compose-sqlite-storage
docker-compose up

As for the chart, it's a brand new feature, so it might have some bugs, but here's what I think might answer some of your questions:

luckman212 commented 3 years ago

Thanks for the help @TwinProduction - I tried cloning the git repo and running the example directly (it works 👍 )

I see the data.db that gets created seems persistent. So I am still very cloudy and hazy about how the container storage works (volumes, temp filesystems, etc). That isn't directly an issue with Gatus of course, just my ignorance of how Docker works.

Thank you for opening #162

I will continue banging my head against this hard surface until it clicks into place.

TwiN commented 3 years ago

Hahaha good luck, then!

I'll close this in the meantime, but if you have any questions, don't hesitate to ask.