diff --git a/.env.example b/.env.example index cc69926..a202794 100644 --- a/.env.example +++ b/.env.example @@ -1,15 +1,23 @@ IMAGE_BASE=registry.cn-hangzhou.aliyuncs.com/aix_chenc - +OPENRESTY_VERSION=1.25.3.1 ################ Net Congfig ###################### NET_SUBNET=10.12.25 +################# WEB目录 ###################### +WWWROOT_PATH="./www" + +################# PHP Config ###################### +PHP73_VERSION=7.3.33 +PHP74_VERSION=7.4.33 +PHP81_VERSION=8.1.24 +PHP83_VERSION=8.3.0 + ################ Elasticsearch ###################### ELK_VERSION=7.17.10 ELASTICSEARCH_HOST_HTTP_PORT=9200 ELK_ELASTIC_PASSWD=qq1458513 -################# WEB目录 ###################### -WWWROOT_PATH="./www" + ################# NodeJS ################## NODEJS_VERSION="18.17.0" diff --git a/docker-compose.yaml.example b/docker-compose.yaml.example index eed37aa..b62c0ac 100644 --- a/docker-compose.yaml.example +++ b/docker-compose.yaml.example @@ -77,7 +77,7 @@ services: - redis openresty: - image: ${IMAGE_BASE}/openresty:1.21.4.1 + image: ${IMAGE_BASE}/openresty:${OPENRESTY_VERSION:1.25.3.1} container_name: openresty restart: always ports: @@ -126,7 +126,7 @@ services: ipv4_address: ${NET_SUBNET:-10.12.25}.3 php73: - image: ${IMAGE_BASE}/php:7.3.33 + image: ${IMAGE_BASE}/php:${PHP73_VERSION:7.3.33} container_name: php73 restart: always volumes: @@ -156,7 +156,7 @@ services: - redis php74: - image: ${IMAGE_BASE}/php:7.4.33 + image: ${IMAGE_BASE}/php:${PHP74_VERSION:7.4.33} container_name: php74 restart: always volumes: @@ -185,7 +185,7 @@ services: - redis php81: - image: ${IMAGE_BASE}/php:8.1.24 + image: ${IMAGE_BASE}/php:${PHP81_VERSION:8.1.24} container_name: php81 restart: always volumes: @@ -215,7 +215,7 @@ services: condition: service_healthy php83: - image: ${IMAGE_BASE}/php:8.3.0 + image: ${IMAGE_BASE}/php:${PHP83_VERSION:8.3.0} container_name: php83 restart: always volumes: diff --git a/openresty/config/conf/.gitignore b/openresty/config/conf/.gitignore new file mode 100644 index 0000000..4ed253b --- /dev/null +++ b/openresty/config/conf/.gitignore @@ -0,0 +1 @@ +nginx.conf \ No newline at end of file diff --git a/openresty/config/conf/nginx.conf b/openresty/config/conf/nginx.conf.example similarity index 82% rename from openresty/config/conf/nginx.conf rename to openresty/config/conf/nginx.conf.example index 44764b7..f59eae7 100644 --- a/openresty/config/conf/nginx.conf +++ b/openresty/config/conf/nginx.conf.example @@ -79,30 +79,10 @@ lua_shared_dict my_limit_req_store1 100m; stub_status on; access_log off; } - location ~ ^/(status_73|ping_73)$ { - access_log off; - fastcgi_pass php73:9000; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi.conf; - } - location ~ ^/(status_74|ping_74)$ { - access_log off; - fastcgi_pass php74:9000; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi.conf; - } - location ~ ^/(status_81|ping_81)$ { - access_log off; - fastcgi_pass php81:9000; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi.conf; - } - location ~ ^/(status_83|ping_83)$ { - access_log off; - fastcgi_pass php83:9000; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi.conf; - } + include ping/php73.conf; + include ping/php74.conf; + include ping/php81.conf; + include ping/php83.conf; location /aix-agent { proxy_pass http://host.docker.internal:10115/; } diff --git a/openresty/config/conf/ping/php73.conf b/openresty/config/conf/ping/php73.conf new file mode 100644 index 0000000..1b97072 --- /dev/null +++ b/openresty/config/conf/ping/php73.conf @@ -0,0 +1,6 @@ +location ~ ^/(status_73|ping_73)$ { + access_log off; + fastcgi_pass php73:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi.conf; +} \ No newline at end of file diff --git a/openresty/config/conf/ping/php74.conf b/openresty/config/conf/ping/php74.conf new file mode 100644 index 0000000..dc5fcc1 --- /dev/null +++ b/openresty/config/conf/ping/php74.conf @@ -0,0 +1,6 @@ +location ~ ^/(status_74|ping_74)$ { + access_log off; + fastcgi_pass php74:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi.conf; +} \ No newline at end of file diff --git a/openresty/config/conf/ping/php81.conf b/openresty/config/conf/ping/php81.conf new file mode 100644 index 0000000..922b06f --- /dev/null +++ b/openresty/config/conf/ping/php81.conf @@ -0,0 +1,6 @@ +location ~ ^/(status_81|ping_81)$ { + access_log off; + fastcgi_pass php81:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi.conf; +} \ No newline at end of file diff --git a/openresty/config/conf/ping/php83.conf b/openresty/config/conf/ping/php83.conf new file mode 100644 index 0000000..b5d72e3 --- /dev/null +++ b/openresty/config/conf/ping/php83.conf @@ -0,0 +1,6 @@ +location ~ ^/(status_83|ping_83)$ { + access_log off; + fastcgi_pass php83:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi.conf; +} \ No newline at end of file diff --git a/start.sh b/start.sh index 9c96eff..74d209e 100644 --- a/start.sh +++ b/start.sh @@ -1,4 +1,6 @@ #!/bin/bash +docker_version="26.0.0" +docker_compose_ver="2.26.0" docker_path="/data/aix-docker" cd /data print_error() { @@ -30,12 +32,12 @@ if ! command -v jq >/dev/null 2>&1 ; then fi fi if ! command -v docker >/dev/null 2>&1 ; then - wget --no-check-certificate https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/docker-20.10.9.tgz + wget --no-check-certificate https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/docker-${docker_version}.tgz if [ $? -ne 0 ]; then print_error "Download docker failed" exit 1 fi - tar -zxvf docker-20.10.9.tgz + tar -zxvf docker-${docker_version}.tgz mv docker/* /usr/bin/ groupadd docker cat > /usr/lib/systemd/system/docker.service << EOF @@ -66,7 +68,7 @@ systemctl enable docker fi if ! command -v docker-compose >/dev/null 2>&1 ; then - curl -L https://gh-mirrors.qra.ink/https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose + curl -L https://gh-proxy.com/https://github.com/docker/compose/releases/download/v${docker_compose_ver}/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose fi