services: change restart policy to unless-stopped
when we stop an app, the service containers are stopped. they start running again on reboot. correct restart policy is "unless-stopped" for all the containers.
This commit is contained in:
+6
-6
@@ -1022,7 +1022,7 @@ async function startTurn(existingInfra) {
|
||||
// despite --userland-proxy=false, docker create a firewall rule for each port in a range. this takes over 20s to start/stop containers
|
||||
// constants.TURN_PORT, constants.TURN_TLS_PORT, constants.TURN_UDP_PORT_START, constants.TURN_UDP_PORT_END are exposed automatically in host mode
|
||||
// https://github.com/moby/moby/issues/8356 and https://github.com/moby/moby/issues/14856 https://github.com/moby/moby/issues/36214
|
||||
const runCmd = `docker run --restart=always -d --name=turn \
|
||||
const runCmd = `docker run --restart=unless-stopped -d --name=turn \
|
||||
--hostname turn \
|
||||
--net host \
|
||||
--log-driver syslog \
|
||||
@@ -1232,7 +1232,7 @@ async function startMysql(existingInfra) {
|
||||
const cmd = serviceConfig.recoveryMode ? '/bin/bash -c \'echo "Debug mode. Sleeping" && sleep infinity\'' : '';
|
||||
|
||||
// memory options are applied dynamically. import requires all the memory we can get
|
||||
const runCmd = `docker run --restart=always -d --name=mysql \
|
||||
const runCmd = `docker run --restart=unless-stopped -d --name=mysql \
|
||||
--hostname mysql \
|
||||
--net cloudron \
|
||||
--net-alias mysql \
|
||||
@@ -1453,7 +1453,7 @@ async function startPostgresql(existingInfra) {
|
||||
const cmd = serviceConfig.recoveryMode ? '/bin/bash -c \'echo "Debug mode. Sleeping" && sleep infinity\'' : '';
|
||||
|
||||
// memory options are applied dynamically. import requires all the memory we can get
|
||||
const runCmd = `docker run --restart=always -d --name=postgresql \
|
||||
const runCmd = `docker run --restart=unless-stopped -d --name=postgresql \
|
||||
--hostname postgresql \
|
||||
--net cloudron \
|
||||
--net-alias postgresql \
|
||||
@@ -1600,7 +1600,7 @@ async function startMongodb(existingInfra) {
|
||||
const cmd = serviceConfig.recoveryMode ? '/bin/bash -c \'echo "Debug mode. Sleeping" && sleep infinity\'' : '';
|
||||
|
||||
// memory options are applied dynamically. import requires all the memory we can get
|
||||
const runCmd = `docker run --restart=always -d --name=mongodb \
|
||||
const runCmd = `docker run --restart=unless-stopped -d --name=mongodb \
|
||||
--hostname mongodb \
|
||||
--net cloudron \
|
||||
--net-alias mongodb \
|
||||
@@ -1776,7 +1776,7 @@ async function startGraphite(existingInfra) {
|
||||
const cmd = serviceConfig.recoveryMode ? '/bin/bash -c \'echo "Debug mode. Sleeping" && sleep infinity\'' : '';
|
||||
|
||||
// port 2003 is used by collectd
|
||||
const runCmd = `docker run --restart=always -d --name=graphite \
|
||||
const runCmd = `docker run --restart=unless-stopped -d --name=graphite \
|
||||
--hostname graphite \
|
||||
--net cloudron \
|
||||
--net-alias graphite \
|
||||
@@ -1923,7 +1923,7 @@ async function setupRedis(app, options) {
|
||||
const image = infra.images.redis;
|
||||
const label = app.fqdn;
|
||||
// note that we do not add appId label because this interferes with the stop/start app logic
|
||||
const runCmd = `docker run --restart=always -d --name=${redisName} \
|
||||
const runCmd = `docker run --restart=unless-stopped -d --name=${redisName} \
|
||||
--hostname ${redisName} \
|
||||
--label=location=${label} \
|
||||
--net cloudron \
|
||||
|
||||
Reference in New Issue
Block a user