Sfoglia il codice sorgente

🐛: fix depends on

ulyc 2 anni fa
parent
commit
5a52bc79fd
1 ha cambiato i file con 16 aggiunte e 4 eliminazioni
  1. 16 4
      template/docker-compose.yml.template

+ 16 - 4
template/docker-compose.yml.template

@@ -1,4 +1,4 @@
-version: '3.4'
+version: '3.9'
 
 services:
   redis-kv:
@@ -16,16 +16,25 @@ services:
       POSTGRES_MULTIPLE_DATABASES: metasrht,{{database_name}}
     networks:
       - srht-net
+    healthcheck:
+        test: ["CMD", "pg_isready", "-U", "metasrht"]
+        interval: 10s
+        timeout: 5s
+        retries: 3
+
   srhts:
     build: ./
     volumes:
       - git-data:/var/lib/git
       - ./config.ini:/etc/sr.ht/config.ini
+      - static-data:/usr/lib/python3.9/site-packages/
+
     networks:
       - srht-net
     depends_on:
-      - database
-      - redis-kv
+      database:
+          condition: service_healthy
+
 
   nginx:
     image: nginx:alpine
@@ -33,14 +42,17 @@ services:
       - '80:80'
     volumes:
       - ./nginx_conf/:/etc/nginx/
+      - static-data:/usr/lib/python3.9/site-packages/
     networks:
       - srht-net
     depends_on:
-      - srhts
+      srhts:
+        condition: service_healthy
 
 volumes:
   db-data:
   git-data:
+  static-data:
 
 
 networks: