This commit is contained in:
parent
c1b26cd4cd
commit
af8fbdbc8e
|
|
@ -4,11 +4,22 @@
|
||||||
export DOMAIN=bazhong
|
export DOMAIN=bazhong
|
||||||
export NETWORK="swarm_network_$DOMAIN"
|
export NETWORK="swarm_network_$DOMAIN"
|
||||||
export HOST_IP=127.0.0.1
|
export HOST_IP=127.0.0.1
|
||||||
export HOST_NAME=localhost
|
export NGINX_PORT=9988
|
||||||
export REGISTRY=registry.t-aaron.com
|
export REGISTRY=registry.t-aaron.com
|
||||||
|
export SKY_DOMAIN=sky-bazhong.t-aaron.com
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export REGISTRY_HOST=${REGISTRY}/tuoheng/
|
export REGISTRY_HOST=${REGISTRY}/tuoheng/
|
||||||
#export REGISTRY_HOST=""
|
#export REGISTRY_HOST=""
|
||||||
|
|
||||||
|
#Nginx 配置
|
||||||
|
export NGINX_NAME=NGINX_${DOMAIN}
|
||||||
|
export NGINX_IMAGE=${REGISTRY_HOST}nginx:${DOMAIN}
|
||||||
|
export NGINX_HTTP_PORT=80
|
||||||
|
export NGINX_HTTPS_PORT=443
|
||||||
|
export NGINX_MEMORY=256m
|
||||||
|
|
||||||
#MySql 配置
|
#MySql 配置
|
||||||
export MYSQL_PORT=3308
|
export MYSQL_PORT=3308
|
||||||
export MYSQL_ROOT_PASSWORD=tuoheng2024
|
export MYSQL_ROOT_PASSWORD=tuoheng2024
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
source ../environment.sh
|
||||||
|
|
||||||
|
# 检查并停止/删除已存在的容器
|
||||||
|
if docker ps -a | grep -q ${NGINX_NAME}; then
|
||||||
|
echo "停止并删除已存在的 ${NGINX_NAME} 容器..."
|
||||||
|
docker stop ${NGINX_NAME} >/dev/null 2>&1
|
||||||
|
docker rm ${NGINX_NAME} >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 启动Nginx容器
|
||||||
|
docker run -d \
|
||||||
|
--name ${NGINX_NAME} \
|
||||||
|
--network ${NETWORK} \
|
||||||
|
-p ${NGINX_HTTP_PORT}:80 \
|
||||||
|
-p ${NGINX_HTTPS_PORT}:443 \
|
||||||
|
--env TZ=Asia/Shanghai \
|
||||||
|
--memory ${NGINX_MEMORY} \
|
||||||
|
--restart unless-stopped \
|
||||||
|
${NGINX_IMAGE}
|
||||||
|
|
||||||
|
# 显示运行中的容器
|
||||||
|
docker ps
|
||||||
Loading…
Reference in New Issue