From e8c2aa4abaece34ce844c148d199e33df50aed75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 25 Jun 2024 13:38:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20windows=20?= =?UTF-8?q?=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/windows.yml | 26 ++++++++++++++++++++++++++ scripts/utils.sh | 18 +++--------------- 2 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 compose/windows.yml diff --git a/compose/windows.yml b/compose/windows.yml new file mode 100644 index 0000000..71a269f --- /dev/null +++ b/compose/windows.yml @@ -0,0 +1,26 @@ +services: + windows: + image: dockurr/windows + container_name: windows + environment: + TZ: ${TZ:-Asia/Shanghai} + VERSION: ${WINDOWS_VERSION:-2022} + DISK_SIZE: ${WINDOWS_DISK_SIZE:-64G} + LANGUAGE: ${WINDOWS_LANGUAGE:-Chinese} + USERNAME: ${WINDOWS_USERNAME:-administrator} + PASSWORD: $BOOTSTRAP_TOKEN + devices: + - /dev/kvm + cap_add: + - NET_ADMIN + ports: + - 8006:8006 + - 3389:3389/tcp + - 3389:3389/udp + # - 5985:5985 + # - 5986:5986 + # volumes: + # - ${VOLUME_DIR}/windows/data/windows.iso:/custom.iso + stop_grace_period: 2m + networks: + - net \ No newline at end of file diff --git a/scripts/utils.sh b/scripts/utils.sh index 64b9270..3fe9424 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -279,6 +279,7 @@ function get_docker_compose_services() { redis_host=$(get_config REDIS_HOST) use_es=$(get_config USE_ES) use_minio=$(get_config USE_MINIO) + use_windows=$(get_config USE_WINDOWS) use_loki=$(get_config USE_LOKI) use_xpack=$(get_config_or_env USE_XPACK) @@ -309,6 +310,7 @@ function get_docker_compose_services() { [[ "${use_es}" == "1" ]] && services+=" es" [[ "${use_minio}" == "1" ]] && services+=" minio" + [[ "${use_windows}" == "1" ]] && services+=" windows" [[ "${use_loki}" == "1" ]] && services+=" loki" if [[ "${use_xpack}" == "1" ]]; then @@ -327,7 +329,6 @@ function get_docker_compose_cmd_line() { use_ipv6=$(get_config USE_IPV6) use_xpack=$(get_config_or_env USE_XPACK) https_port=$(get_config HTTPS_PORT) - db_images_file=$(get_db_images_file) cmd="docker compose" if [[ "${use_ipv6}" != "1" ]]; then cmd+=" -f compose/network.yml" @@ -343,27 +344,14 @@ function get_docker_compose_cmd_line() { done if [[ "${services}" =~ "mysql" || "${services}" =~ "postgresql" ]]; then + db_images_file=$(get_db_images_file) cmd+=" -f ${db_images_file}" fi - use_es=$(get_config USE_ES) - if [[ "${use_es}" == "1" ]]; then - cmd+=" -f compose/es.yml" - fi - - use_minio=$(get_config USE_MINIO) - if [[ "${use_minio}" == "1" ]]; then - cmd+=" -f compose/minio.yml" - fi - if [[ -n "${https_port}" ]]; then cmd+=" -f compose/lb.yml" fi - if [[ "${services}" =~ loki ]]; then - cmd+=" -f compose/loki.yml" - fi - if [[ "${use_xpack}" == '1' ]]; then for service in magnus razor xrdp video panda; do if [[ "${services}" =~ ${service} ]]; then