瀏覽代碼

refactor(docker-compose): change container to restart policy "unless-stopped"

Nicolas Meienberger 1 年之前
父節點
當前提交
c18b00e78b
共有 2 個文件被更改,包括 8 次插入7 次删除
  1. 4 3
      packages/cli/assets/docker-compose.yml
  2. 4 4
      packages/worker/src/lib/docker/docker-helpers.test.ts

+ 4 - 3
packages/cli/assets/docker-compose.yml

@@ -4,7 +4,7 @@ services:
   tipi-reverse-proxy:
   tipi-reverse-proxy:
     container_name: tipi-reverse-proxy
     container_name: tipi-reverse-proxy
     image: traefik:v2.8
     image: traefik:v2.8
-    restart: on-failure
+    restart: unless-stopped
     depends_on:
     depends_on:
       - tipi-dashboard
       - tipi-dashboard
     ports:
     ports:
@@ -42,7 +42,7 @@ services:
   tipi-redis:
   tipi-redis:
     container_name: tipi-redis
     container_name: tipi-redis
     image: redis:7.2.0
     image: redis:7.2.0
-    restart: on-failure
+    restart: unless-stopped
     command: redis-server --requirepass ${REDIS_PASSWORD}
     command: redis-server --requirepass ${REDIS_PASSWORD}
     ports:
     ports:
       - 6379:6379
       - 6379:6379
@@ -59,6 +59,7 @@ services:
   tipi-worker:
   tipi-worker:
     container_name: tipi-worker
     container_name: tipi-worker
     image: ghcr.io/runtipi/worker:${TIPI_VERSION}
     image: ghcr.io/runtipi/worker:${TIPI_VERSION}
+    restart: unless-stopped
     user: root
     user: root
     healthcheck:
     healthcheck:
       test: ['CMD', 'curl', '-f', 'http://localhost:3000/healthcheck']
       test: ['CMD', 'curl', '-f', 'http://localhost:3000/healthcheck']
@@ -95,7 +96,7 @@ services:
 
 
   tipi-dashboard:
   tipi-dashboard:
     image: ghcr.io/runtipi/runtipi:${TIPI_VERSION}
     image: ghcr.io/runtipi/runtipi:${TIPI_VERSION}
-    restart: on-failure
+    restart: unless-stopped
     container_name: tipi-dashboard
     container_name: tipi-dashboard
     networks:
     networks:
       - tipi_main_network
       - tipi_main_network

+ 4 - 4
packages/worker/src/lib/docker/docker-helpers.test.ts

@@ -34,7 +34,7 @@ describe('docker helpers', async () => {
 
 
     // assert
     // assert
     const expected = [
     const expected = [
-      'docker compose',
+      'docker-compose',
       `--env-file /storage/app-data/${appId}/app.env`,
       `--env-file /storage/app-data/${appId}/app.env`,
       `--project-name ${appId}`,
       `--project-name ${appId}`,
       `-f /app/apps/${appId}/docker-compose.yml`,
       `-f /app/apps/${appId}/docker-compose.yml`,
@@ -58,7 +58,7 @@ describe('docker helpers', async () => {
 
 
     // assert
     // assert
     const expected = [
     const expected = [
-      'docker compose',
+      'docker-compose',
       `--env-file /storage/app-data/${appId}/app.env`,
       `--env-file /storage/app-data/${appId}/app.env`,
       `--env-file ${userEnvFile}`,
       `--env-file ${userEnvFile}`,
       `--project-name ${appId}`,
       `--project-name ${appId}`,
@@ -83,7 +83,7 @@ describe('docker helpers', async () => {
 
 
     // assert
     // assert
     const expected = [
     const expected = [
-      'docker compose',
+      'docker-compose',
       `--env-file /storage/app-data/${appId}/app.env`,
       `--env-file /storage/app-data/${appId}/app.env`,
       `--project-name ${appId}`,
       `--project-name ${appId}`,
       `-f /app/apps/${appId}/docker-compose.yml`,
       `-f /app/apps/${appId}/docker-compose.yml`,
@@ -112,7 +112,7 @@ describe('docker helpers', async () => {
 
 
     // assert
     // assert
     const expected = [
     const expected = [
-      'docker compose',
+      'docker-compose',
       `--env-file /storage/app-data/${appId}/app.env`,
       `--env-file /storage/app-data/${appId}/app.env`,
       `--project-name ${appId}`,
       `--project-name ${appId}`,
       `-f ${arm64ComposeFile}`,
       `-f ${arm64ComposeFile}`,