F43nd1r / Acrarium

A Backend for ACRA written in Kotlin using Spring Boot, Vaadin and MySQL
Apache License 2.0
195 stars 51 forks source link

Can't auto-start Acrarium on reboot #495

Closed aloz77 closed 5 months ago

aloz77 commented 6 months ago

After basic setup on Debian 11 according to https://github.com/F43nd1r/Acrarium/wiki/Setup-guide I can start/stop Acrarium by these commands without issues.

docker-compose up -d
docker-compose stop

However if machine is rebooted on the next restart I encounter a situation that mysql isn't started and acrarium keeps restarting.

# docker ps -a
CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                                  PORTS                    NAMES
b53a07c38f78   f43nd1r/acrarium:latest        "/bin/sh -c 'java or…"   3 minutes ago    Restarting (1) Less than a second ago                            acrarium
d55549868ecf   mysql:5.7                      "docker-entrypoint.s…"   44 minutes ago   Exited (0) About a minute ago                                    database

Any idea how to fix it?

F43nd1r commented 6 months ago

acrarium will restart until the db is available I guess. You'd have to check the container logs of the db to see what is going on.

aloz77 commented 6 months ago

Should mysql in the docker autostart according to your recommended docker config?

I solved the issue for me by using the external (existing) mysql server.

F43nd1r commented 5 months ago

I'm using external db as well, not too confident in the behaviour of dockerized mysql. Probably could add a restart statement there to fix it as well, but if you found a solution that works for you, great.