feat: gateway部署调整
This commit is contained in:
@@ -86,18 +86,22 @@ services:
|
|||||||
restart: ${RESTART_OPTION}
|
restart: ${RESTART_OPTION}
|
||||||
|
|
||||||
wfc-gateway:
|
wfc-gateway:
|
||||||
image: wfc-java:jre8
|
build:
|
||||||
|
context: ./wfc/gateway
|
||||||
container_name: wfc-gateway
|
container_name: wfc-gateway
|
||||||
ports:
|
ports:
|
||||||
- "${GATEWAY_SERVER_PORT}:${GATEWAY_SERVER_PORT}"
|
- "${GATEWAY_SERVER_PORT}:${GATEWAY_SERVER_PORT}"
|
||||||
networks:
|
networks:
|
||||||
- wfc-be-network
|
- wfc-be-network
|
||||||
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
- ./wfc/gateway/jar/wfc-gateway.jar:/opt/wfc/app.jar
|
- ./wfc/gateway/jar/wfc-gateway.jar:/opt/wfc/app.jar
|
||||||
- ./conf/application-common.yml:/opt/wfc/conf/application-common.yml
|
- ./conf/application-common.yml:/opt/wfc/conf/application-common.yml
|
||||||
- ./conf/i18n/:/opt/wfc/conf/i18n
|
- ./conf/i18n/:/opt/wfc/conf/i18n
|
||||||
- ./wfc/gateway/conf/application.yml:/opt/wfc/conf/application.yml
|
- ./wfc/gateway/conf/application.yml:/opt/wfc/conf/application.yml
|
||||||
- ./conf/license:/opt/wfc/license
|
- ./conf/license:/opt/wfc/license
|
||||||
|
- /sbin/dmidecode:/sbin/dmidecode
|
||||||
|
- /dev/mem:/dev/mem
|
||||||
depends_on:
|
depends_on:
|
||||||
wfc-redis:
|
wfc-redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ CPU=""
|
|||||||
MB=""
|
MB=""
|
||||||
IP=""
|
IP=""
|
||||||
MAC=""
|
MAC=""
|
||||||
|
CODE=""
|
||||||
|
|
||||||
# 解析命令行参数
|
# 解析命令行参数
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
@@ -45,6 +46,10 @@ while [[ $# -gt 0 ]]; do
|
|||||||
-cpu|--cpu)
|
-cpu|--cpu)
|
||||||
CPU="$2"
|
CPU="$2"
|
||||||
shift 2
|
shift 2
|
||||||
|
;;
|
||||||
|
-code|--code)
|
||||||
|
CODE="$2"
|
||||||
|
shift 2
|
||||||
;;
|
;;
|
||||||
-mb|--mb)
|
-mb|--mb)
|
||||||
MB="$2"
|
MB="$2"
|
||||||
@@ -72,14 +77,21 @@ echo "ip序列号: $MB"
|
|||||||
|
|
||||||
IP=$(printf "%s\",\"" "${IPS[@]}")
|
IP=$(printf "%s\",\"" "${IPS[@]}")
|
||||||
IP=${IP%\",\"}
|
IP=${IP%\",\"}
|
||||||
|
if [ ! -z "$IP" ]; then
|
||||||
|
IP=\"$IP\"
|
||||||
|
fi
|
||||||
MAC=$(printf "%s\",\"" "${MACS[@]}")
|
MAC=$(printf "%s\",\"" "${MACS[@]}")
|
||||||
MAC=${MAC%\",\"}
|
MAC=${MAC%\",\"}
|
||||||
|
if [ ! -z "$MAC" ]; then
|
||||||
|
MAC=\"$MAC\"
|
||||||
|
fi
|
||||||
|
|
||||||
RAW='{
|
RAW='{
|
||||||
"expiryTime": "'$TIME'",
|
"expiryTime": "'$TIME'",
|
||||||
"ipAddress": ["'$IP'"],
|
"ipAddress": ['$IP'],
|
||||||
"macAddress": ["'$MAC'"],
|
"macAddress": ['$MAC'],
|
||||||
"cpuSerial": "'$CPU'",
|
"cpuSerial": "'$CPU'",
|
||||||
|
"activationCode": "'$CODE'",
|
||||||
"mainBoardSerial": "'$MB'"
|
"mainBoardSerial": "'$MB'"
|
||||||
}'
|
}'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,28 @@
|
|||||||
# 基础镜像
|
# 使用Ubuntu 22.04 LTS作为基础镜像
|
||||||
FROM openjdk:8-jre
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
# 设置时区(可选)
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
# 编码格式
|
||||||
|
ENV LANG en_US.UTF-8
|
||||||
|
ENV LANGUAGE en_US:en
|
||||||
|
ENV LC_ALL en_US.UTF-8
|
||||||
|
|
||||||
|
# 安装OpenJDK 8
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y openjdk-8-jre && \
|
||||||
|
apt-get install -y locales && \
|
||||||
|
apt-get install -y curl && \
|
||||||
|
locale-gen en_US.UTF-8 && \
|
||||||
|
update-locale LANG=en_US.UTF-8 && \
|
||||||
|
apt-get clean;
|
||||||
|
|
||||||
|
# 设置JAVA_HOME环境变量
|
||||||
|
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
|
||||||
|
ENV PATH $JAVA_HOME/bin:$PATH
|
||||||
|
|
||||||
# author
|
# author
|
||||||
LABEL org.wfc.image.authors="wfc@wfc.org"
|
LABEL org.wfc.image.authors="wfc@wfc.org"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user