EDIT 1: Ok maybe I need to use --force-recreate? Or maybe with the CMD option I’m falsely overriding stuff from the Seatable Dockerfile?
How can I integrate the following command to start the service into my docker-compose.yml? (so I can have a restart policy automatically restart the working service):
docker exec -d seatable /shared/seatable/scripts/seatable.sh start
I add restart: always
to the seatable container in the docker-compose.yml.
I also add command: /bin/sh -c "sleep 5; /shared/seatable/scripts/seatable.sh start"
to the docker-compose.yml in order to wait a bit and then start the service.
But restarting via docker-compose up -d
gets the container in a restart loop.
What am I missing here? Is 5 seconds maybe not enough?
# docker-compose.yml
version: '2.0'
services:
db:
image: mariadb:10.5
container_name: seatable-mysql
labels:
- "traefik.enable=false"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_LOG_CONSOLE=true
volumes:
- ./mysql-data:/var/lib/mysql
networks:
- seatable-internal
restart: always
memcached:
image: memcached:1.5.6
container_name: seatable-memcached
labels:
- "traefik.enable=false"
entrypoint: memcached -m 256
networks:
- seatable-internal
restart: always
redis:
image: redis:5.0.7
container_name: seatable-redis
labels:
- "traefik.enable=false"
networks:
- seatable-internal
restart: always
seatable:
image: seatable/seatable-developer:2.7.0
container_name: seatable
labels:
- "traefik.enable=true"
- "traefik.http.routers.seatable.rule=Host(`${SEATABLE_SERVER_HOSTNAME}`)"
- "traefik.http.routers.seatable.entrypoints=secure"
- "traefik.http.routers.seatable.tls.certresolver=le"
ports:
- "81:80"
- "444:443"
volumes:
- ./seatable-data:/shared
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=${MYSQL_ROOT_PASSWORD}
- SEATABLE_SERVER_LETSENCRYPT=False
- SEATABLE_SERVER_HOSTNAME=${SEATABLE_SERVER_HOSTNAME}
- TIME_ZONE=Etc/UTC
depends_on:
- db
- memcached
- redis
networks:
- seatable-internal
- traefik
# restart: always
# Wait 5 seconds to start seatable to make sure all containers are ready
# command: /bin/sh -c "sleep 5; /shared/seatable/scripts/seatable.sh start"
networks:
traefik:
external: true
seatable-internal: