feat: gateway部署调整
This commit is contained in:
@@ -86,18 +86,22 @@ services:
|
||||
restart: ${RESTART_OPTION}
|
||||
|
||||
wfc-gateway:
|
||||
image: wfc-java:jre8
|
||||
build:
|
||||
context: ./wfc/gateway
|
||||
container_name: wfc-gateway
|
||||
ports:
|
||||
- "${GATEWAY_SERVER_PORT}:${GATEWAY_SERVER_PORT}"
|
||||
networks:
|
||||
- wfc-be-network
|
||||
- wfc-be-network
|
||||
privileged: true
|
||||
volumes:
|
||||
- ./wfc/gateway/jar/wfc-gateway.jar:/opt/wfc/app.jar
|
||||
- ./conf/application-common.yml:/opt/wfc/conf/application-common.yml
|
||||
- ./conf/i18n/:/opt/wfc/conf/i18n
|
||||
- ./wfc/gateway/conf/application.yml:/opt/wfc/conf/application.yml
|
||||
- ./conf/license:/opt/wfc/license
|
||||
- /sbin/dmidecode:/sbin/dmidecode
|
||||
- /dev/mem:/dev/mem
|
||||
depends_on:
|
||||
wfc-redis:
|
||||
condition: service_healthy
|
||||
|
||||
@@ -8,6 +8,7 @@ CPU=""
|
||||
MB=""
|
||||
IP=""
|
||||
MAC=""
|
||||
CODE=""
|
||||
|
||||
# 解析命令行参数
|
||||
while [[ $# -gt 0 ]]; do
|
||||
@@ -46,6 +47,10 @@ while [[ $# -gt 0 ]]; do
|
||||
CPU="$2"
|
||||
shift 2
|
||||
;;
|
||||
-code|--code)
|
||||
CODE="$2"
|
||||
shift 2
|
||||
;;
|
||||
-mb|--mb)
|
||||
MB="$2"
|
||||
shift 2
|
||||
@@ -72,14 +77,21 @@ echo "ip序列号: $MB"
|
||||
|
||||
IP=$(printf "%s\",\"" "${IPS[@]}")
|
||||
IP=${IP%\",\"}
|
||||
if [ ! -z "$IP" ]; then
|
||||
IP=\"$IP\"
|
||||
fi
|
||||
MAC=$(printf "%s\",\"" "${MACS[@]}")
|
||||
MAC=${MAC%\",\"}
|
||||
if [ ! -z "$MAC" ]; then
|
||||
MAC=\"$MAC\"
|
||||
fi
|
||||
|
||||
RAW='{
|
||||
"expiryTime": "'$TIME'",
|
||||
"ipAddress": ["'$IP'"],
|
||||
"macAddress": ["'$MAC'"],
|
||||
"ipAddress": ['$IP'],
|
||||
"macAddress": ['$MAC'],
|
||||
"cpuSerial": "'$CPU'",
|
||||
"activationCode": "'$CODE'",
|
||||
"mainBoardSerial": "'$MB'"
|
||||
}'
|
||||
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# 使用Ubuntu 22.04 LTS作为基础镜像
|
||||
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
|
||||
LABEL org.wfc.image.authors="wfc@wfc.org"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user