From 3b251f974515b55505cc5912fbb0c9d4eeded24e Mon Sep 17 00:00:00 2001 From: axzsd Date: Tue, 23 May 2023 14:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/Dockerfile-pro | 20 ++++++++++++++++++++ builds/docker-compose-prod.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 builds/Dockerfile-pro create mode 100644 builds/docker-compose-prod.yml diff --git a/builds/Dockerfile-pro b/builds/Dockerfile-pro new file mode 100644 index 000000000..5d904f4c6 --- /dev/null +++ b/builds/Dockerfile-pro @@ -0,0 +1,20 @@ +FROM registry.cn-hangzhou.aliyuncs.com/lrh-public/openjdk:8u222-jre-up + +LABEL Author="axzsd" \ + Email="atva725@qq.com" \ + Description="创盈支付服务端" + +ENV SPRING_PROFILES_ACTIVE="prod" +ENV JAVA_OPTIONS "-Xms4000m -Xmx4096m \ +-XX:+HeapDumpOnOutOfMemoryError \ +-Dfile.encoding=UTF-8 \ +-Djava.awt.headless=true \ +-Dsun.net.client.defaultConnectTimeout=10000 \ +-Dsun.net.client.defaultReadTimeout=30000" + + +WORKDIR /work/projects/yudao-server +COPY yudao-server/target/yudao-server.jar /opt/app.jar + +EXPOSE 48080 +ENTRYPOINT exec java $JAVA_OPTIONS -jar -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} /opt/app.jar diff --git a/builds/docker-compose-prod.yml b/builds/docker-compose-prod.yml new file mode 100644 index 000000000..1a7a73eb6 --- /dev/null +++ b/builds/docker-compose-prod.yml @@ -0,0 +1,28 @@ +version: "3.9" +services: + yudao-server: + image: ${IMAGE_VERSION} + restart: always + privileged: true + container_name: yudao-server + environment: + TZ: Asia/Shanghai + SPRING_PROFILES_ACTIVE: prod +# volumes: +# - /opt/logs/cyywl:/work/projects/yudao-server + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + ports: + - "48080:48080" + deploy: + resources: + limits: + memory: 4096MB + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:48080/actuator/health"] + timeout: 30s + interval: 45s + retries: 3 \ No newline at end of file