Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

移除dockerize,使用原生healthcheck #2413

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading