init: 信创文件安全传输系统内外网本地 Docker 部署
包含 s-file 后端、React 前端、MeshSafe 安全检测对接,以及内外网两套 compose/nginx/配置(仅前端 28180/28280 对外发布,其余端口不暴露)。 说明:deploy/config/application-iw.yml 与 application-ow.yml 按维护者 明确要求原样入库,其中含本机 Docker 用的库口令、RabbitMQ 口令与 JWT 密钥;上生产前需替换。
This commit is contained in:
15
deploy/docker/Dockerfile.app
Normal file
15
deploy/docker/Dockerfile.app
Normal file
@@ -0,0 +1,15 @@
|
||||
# s-file 后端运行镜像(构建上下文 = backend/target,内含 s-file.jar)
|
||||
# 用 JVM 参数 -Xmx 控制内存,配置文件由容器挂载 /config/application.yml
|
||||
FROM eclipse-temurin:8-jre-jammy
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV JAVA_OPTS="-Xms256m -Xmx1g -Dfile.encoding=UTF-8"
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
WORKDIR /app
|
||||
COPY s-file.jar /app/s-file.jar
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["sh", "-c", "exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app/s-file.jar"]
|
||||
28
deploy/docker/Dockerfile.web
Normal file
28
deploy/docker/Dockerfile.web
Normal file
@@ -0,0 +1,28 @@
|
||||
# 前端镜像:一次构建同时产出内网包与外网包
|
||||
# 构建上下文 = frontend/ (见 frontend/.dockerignore)
|
||||
# 站点根:/usr/share/nginx/inside(内网)、/usr/share/nginx/outside(外网)
|
||||
# 由两套 nginx 容器各挂一份 conf 选择站点根,镜像只读共用
|
||||
FROM node:20 AS build
|
||||
|
||||
WORKDIR /src
|
||||
COPY package.json ./
|
||||
RUN npm config set registry https://registry.npmmirror.com \
|
||||
&& npm install --no-audit --no-fund
|
||||
|
||||
COPY . .
|
||||
|
||||
# .env.production.local 优先级高于 .env.production,用它固化两套包的差异:
|
||||
# VITE_API_URL=/api —— 走同域 /api,由 nginx 反代时去掉前缀
|
||||
# VITE_IS_INSIDE —— true 内网包 / false 外网包
|
||||
RUN set -eux; \
|
||||
printf 'VITE_API_URL=/api\nVITE_IS_INSIDE=true\n' > .env.production.local; \
|
||||
npx vite build --outDir dist/inside; \
|
||||
printf 'VITE_API_URL=/api\nVITE_IS_INSIDE=false\n' > .env.production.local; \
|
||||
npx vite build --outDir dist/outside
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY --from=build /src/dist/inside /usr/share/nginx/inside
|
||||
COPY --from=build /src/dist/outside /usr/share/nginx/outside
|
||||
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user