From 6c2510147f29ee4f94ff70f910897c9be308276d Mon Sep 17 00:00:00 2001 From: SkyJourney Date: Tue, 19 Dec 2023 05:51:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ci/Dockerfile | 4 ++++ .ci/docker-compose.build.yaml | 12 ++++++++++++ .ci/docker-compose.yaml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 .ci/Dockerfile create mode 100644 .ci/docker-compose.build.yaml create mode 100644 .ci/docker-compose.yaml diff --git a/.ci/Dockerfile b/.ci/Dockerfile new file mode 100644 index 0000000..89d5dde --- /dev/null +++ b/.ci/Dockerfile @@ -0,0 +1,4 @@ +# 选择更小体积的基础镜像 +FROM nginx:stable-alpine +COPY ./default.conf /etc/nginx/conf.d +COPY ./dist /usr/share/nginx/html \ No newline at end of file diff --git a/.ci/docker-compose.build.yaml b/.ci/docker-compose.build.yaml new file mode 100644 index 0000000..df06d77 --- /dev/null +++ b/.ci/docker-compose.build.yaml @@ -0,0 +1,12 @@ +version: "3.9" + +services: + ms-service: + build: + dockerfile: Dockerfile + context: . + tags: + - "${IMAGE_NAME}:${IMAGE_TAG_LATEST}" + - "${IMAGE_NAME}:${IMAGE_TAG_COMMIT}" + - "${REGISTER_HOST}/${REGISTER_REPO}/${IMAGE_NAME}:${IMAGE_TAG_LATEST}" + - "${REGISTER_HOST}/${REGISTER_REPO}/${IMAGE_NAME}:${IMAGE_TAG_COMMIT}" \ No newline at end of file diff --git a/.ci/docker-compose.yaml b/.ci/docker-compose.yaml new file mode 100644 index 0000000..805975e --- /dev/null +++ b/.ci/docker-compose.yaml @@ -0,0 +1,31 @@ +#版本 +version: '3.9' + +x-template: + service: &service_tmp + restart: always + tty: true + deploy: + resources: + limits: + cpus: '2' + memory: 1G + reservations: + cpus: '0.5' + memory: 256M + extra_hosts: + - "yg.dt.io:192.168.1.5" + +#服务配置 +services: + + emergency-screen: + <<: *service_tmp + container_name: es_${PROFILE_NAME} + hostname: es_${PROFILE_NAME} + image: ${IMAGE_NAME}:${IMAGE_TAG_LATEST} + +networks: + default: + name: ${NETWORK_NAME} + external: true