From 9d434a36d6d8c5a5104679298bcb0028140597a0 Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Wed, 11 May 2022 12:42:08 +0800 Subject: [PATCH] add wait tool for docker-compose --- docker/Dockerfile | 3 ++- docker/docker-compose.yaml | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 72be585f..cac9875f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,8 @@ FROM python:2 WORKDIR /app ADD n9e /app -RUN mkdir -p /app/pub +ADD http://download.flashcat.cloud/wait /wait +RUN mkdir -p /app/pub && chmod +x /wait ADD pub /app/pub/ RUN chmod +x n9e diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 1218c4e3..23a246e5 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -63,6 +63,7 @@ services: environment: GIN_MODE: release TZ: Asia/Shanghai + WAIT_HOSTS: mysql:3306 ports: - "10090:10090" - "20090:20090" @@ -74,18 +75,18 @@ services: - mysql links: - mysql:mysql - command: - - "/app/ibex" - - "server" + command: > + sh -c "/wait && /app/ibex server" nwebapi: - image: ulric2019/nightingale:5.7.0 + image: ulric2019/nightingale:5.7.1 container_name: nwebapi hostname: nwebapi restart: always environment: GIN_MODE: release TZ: Asia/Shanghai + WAIT_HOSTS: mysql:3306, redis:6379 volumes: - ./n9eetc:/app/etc ports: @@ -102,18 +103,18 @@ services: - redis:redis - prometheus:prometheus - ibex:ibex - command: - - "/app/n9e" - - "webapi" + command: > + sh -c "/wait && /app/n9e webapi" nserver: - image: ulric2019/nightingale:5.7.0 + image: ulric2019/nightingale:5.7.1 container_name: nserver hostname: nserver restart: always environment: GIN_MODE: release TZ: Asia/Shanghai + WAIT_HOSTS: mysql:3306, redis:6379 volumes: - ./n9eetc:/app/etc ports: @@ -130,9 +131,8 @@ services: - redis:redis - prometheus:prometheus - ibex:ibex - command: - - "/app/n9e" - - "server" + command: > + sh -c "/wait && /app/n9e server" telegraf: image: "telegraf:1.20.3"