Skip to content

Commit

Permalink
移除dockerize,使用原生healthcheck (#2413)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo authored Nov 25, 2023
1 parent 828e1d7 commit d8159f4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
19 changes: 17 additions & 2 deletions src/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ services:
command: redis-server --requirepass 123456
expose:
- "6379"
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 5

mysql:
image: mysql:5.7
Expand All @@ -21,6 +26,11 @@ services:
environment:
MYSQL_DATABASE: archery
MYSQL_ROOT_PASSWORD: 123456
healthcheck:
test: ["CMD", "mysqladmin", "ping"]
interval: 5s
timeout: 5s
retries: 5

goinception:
image: hanchuanchuan/goinception
Expand All @@ -32,13 +42,18 @@ services:
- "./inception/config.toml:/etc/config.toml"

archery:
# 下方的镜像地址仅为实例, 请前往以下地址确认你需要的版本:
# 下方的镜像地址仅为示例, 请前往以下地址确认你需要的版本:
# dockerhub https://hub.docker.com/r/hhyo/archery
# github packages https://github.com/hhyo/Archery/pkgs/container/archery
# 如有需要, 也可以自行build docker 镜像, 替换为自己的镜像
image: hhyo/archery:v1.10.0
container_name: archery
restart: always
depends_on:
redis:
condition: service_healthy
mysql:
condition: service_healthy
ports:
- "9123:9123"
volumes:
Expand All @@ -49,6 +64,6 @@ services:
- "./archery/sql/migrations:/opt/archery/sql/migrations"
- "./archery/logs:/opt/archery/logs"
- "./archery/keys:/opt/archery/keys"
entrypoint: "dockerize -wait tcp://mysql:3306 -wait tcp://redis:6379 -timeout 60s /opt/archery/src/docker/startup.sh"
entrypoint: "bash /opt/archery/src/docker/startup.sh"
env_file:
- .env
1 change: 0 additions & 1 deletion src/docker/Dockerfile-base
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG PYTHON_BASE_IMAGE=library/python:3.11-bullseye
FROM ${PYTHON_BASE_IMAGE}

ENV DOCKERIZE_VERSION v0.6.1
ENV SOAR_VERSION 0.11.0
ENV TZ Asia/Shanghai

Expand Down
6 changes: 0 additions & 6 deletions src/docker/setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/bin/bash
set -euxo pipefail
curl -q -L -o dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
tar -C /opt -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
chmod +x /opt/dockerize
mv /opt/dockerize /usr/local/bin/
rm -rf dockerize*
#sqladvisor
curl -o sqladvisor -L https://github.com/LeoQuote/SQLAdvisor/releases/download/v2.1/sqladvisor-linux-amd64
chmod +x sqladvisor
Expand Down Expand Up @@ -52,6 +47,5 @@ apt-get clean
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone
chmod +x sqladvisor soar my2sql
chmod +x /usr/local/bin/dockerize
chmod +x /usr/local/bin/mongo
python3 -m venv venv4archery

0 comments on commit d8159f4

Please sign in to comment.