szurubooru
szurubooru copied to clipboard
Make szurubooru autostart on fail
I do not appear to be able to run the container with "docker run szurubooru --restart unless-stopped", so how would I set it up to autostart unless manually stopped?
Please share the error, that you get when running that command.
docker run szurubooru --restart unless-stopped
Unable to find image 'szurubooru:latest' locally
docker: Error response from daemon: pull access denied for szurubooru, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Is there a reason, why you are not using the docker-compose file?. Because szurubooru has multiple images. You are currently trying to pull an image that doesn't exist with that name. But there is szurubooru/server
and szurubooru/client
.
But again, because this also sets up a database and variables to encourage you to use the docker-compose file.
Is there a reason, why you are not using the docker-compose file?. Because szurubooru has multiple images. You are currently trying to pull an image that doesn't exist with that name. But there is
szurubooru/server
andszurubooru/client
. But again, because this also sets up a database and variables to encourage you to use the docker-compose file.
I believe that I am using the compose file, as I followed the installation directions.. I just have to docker compose up -d
every single time
Have you made sure, that you have a docker-compose.yml
file?
And what happens, when you run the command then?
Have you made sure, that you have a
docker-compose.yml
file? And what happens, when you run the command then?
Yes, a docker-compose.yml file is present in the directory that I run docker compose up -d in.
can you try running docker-compose up - d
so with a dash between docker and compose?
can you try running docker-compose up - d
so with a dash between docker and compose?
gave me this error:
ERROR: No such service: -
my bad. keyboard put a space there..
docker-compose up -d
docker-compose up -d
oh my bad I think thats what I was doing initially, i just typed it without the dash by accident. I just did it that way to make sure though and it still doesn't automatically start after restarting my virtual server.
how does your docker-compose file look like? and what is the output from that?
docker-compose.yml:
## Example Docker Compose configuration
##
## Use this as a template to set up docker-compose, or as guide to set up other
## orchestration services
version: '2'
services:
server:
image: szurubooru/server:latest
depends_on:
- sql
environment:
## These should be the names of the dependent containers listed below,
## or FQDNs/IP addresses if these services are running outside of Docker
POSTGRES_HOST: sql
## Credentials for database:
POSTGRES_USER:
POSTGRES_PASSWORD:
## Commented Values are Default:
#POSTGRES_DB: defaults to same as POSTGRES_USER
#POSTGRES_PORT: 5432
#LOG_SQL: 0 (1 for verbose SQL logs)
THREADS:
volumes:
- "${MOUNT_DATA}:/data"
- "./server/config.yaml:/opt/app/config.yaml"
client:
image: szurubooru/client:latest
depends_on:
- server
environment:
BACKEND_HOST: server
BASE_URL:
volumes:
- "${MOUNT_DATA}:/data:ro"
ports:
- "${PORT}:80"
sql:
image: postgres:11-alpine
restart: unless-stopped
environment:
POSTGRES_USER:
POSTGRES_PASSWORD:
volumes:
- "${MOUNT_SQL}:/var/lib/postgresql/data"
output (in this case szurubooru is already running but it basically just says it started the services when i run it and its not running, i can get the exact output if needed):
docker-compose up -d
szuru_sql_1 is up-to-date
szuru_server_1 is up-to-date
szuru_client_1 is up-to-date
the software is already running, tho i can see that, server and client containers do not have restart: unless-stopped
in them
the software is already running, tho i can see that, server and client containers do not have
restart: unless-stopped
in them
should I add that then? also I said that it was already running in the post :) - still doesn't explain the error with the command i was putting initially :p but im glad to have this solution!
Looks like this worked! Thank you so much for the help. Could this possibly be added to the docs so people with this issue could add it to the docker-compose?
yes, you can add them to each service and re-run the command. please double check, if the the volumes have been set correctly otherwise you might loose the data.
to explain the error
1st it wouldnt work since you are trying to create another container with all the settings missing that are in the compose file and env file already pre-configured.
2nd the image name was wrong. only offical images get to have a one word service-name, like mysql or mariadb. szurubooru is not big enough for that so the author is needed in-front: author/serviceName:tagOrVersion
.
well.. it could be directly implemented with a PR but its unlikely that it will be accepted, considering that there are other pending for months now and there might be a good reason, why it wasnt set in the first place...
yes, you can add them to each service and re-run the command. please double check, if the the volumes have been set correctly otherwise you might loose the data.
to explain the error 1st it wouldnt work since you are trying to create another container with all the settings missing that are in the compose file and env file already pre-configured. 2nd the image name was wrong. only offical images get to have a one word service-name, like mysql or mariadb. szurubooru is not big enough for that so the author is needed in-front:
author/serviceName:tagOrVersion
.
how do I check that the volumes are correctly set, I don't remember setting them :p - i already changed it and restarted and it looks like its fine..?