From c25b464b0d86c4599af9c8635dc9f18d3a94fcfd Mon Sep 17 00:00:00 2001 From: Egor Matveev Date: Wed, 17 Sep 2025 18:46:30 +0300 Subject: [PATCH] initial --- .deploy/deploy-dev.yaml | 37 ++++++++++++++++++++++++++++ .deploy/deploy-prod.yaml | 21 ++++++++++++++++ .gitea/workflows/deploy-dev.yaml | 41 +++++++++++++++++++++++++++++++ .gitea/workflows/deploy-prod.yaml | 41 +++++++++++++++++++++++++++++++ Dockerfile | 5 ++++ index.html | 8 ++++++ nginx.conf | 13 ++++++++++ 7 files changed, 166 insertions(+) create mode 100644 .deploy/deploy-dev.yaml create mode 100644 .deploy/deploy-prod.yaml create mode 100644 .gitea/workflows/deploy-dev.yaml create mode 100644 .gitea/workflows/deploy-prod.yaml create mode 100644 Dockerfile create mode 100644 index.html create mode 100644 nginx.conf diff --git a/.deploy/deploy-dev.yaml b/.deploy/deploy-dev.yaml new file mode 100644 index 0000000..ba19735 --- /dev/null +++ b/.deploy/deploy-dev.yaml @@ -0,0 +1,37 @@ +version: "3.4" + + +services: + certupdater: + image: mathwave/sprint-repo:certupdater + command: worker + environment: + MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV + MONGO_PASSWORD: $MONGO_PASSWORD_DEV + STAGE: "development" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + networks: + - configurator + - queues-development + - minio-development + - mongo-development + deploy: + mode: replicated + restart_policy: + condition: any + placement: + constraints: [node.labels.stage == development] + update_config: + parallelism: 1 + order: start-first + +networks: + configurator: + external: true + queues-development: + external: true + minio-development: + external: true + mongo-development: + external: true diff --git a/.deploy/deploy-prod.yaml b/.deploy/deploy-prod.yaml new file mode 100644 index 0000000..53228f2 --- /dev/null +++ b/.deploy/deploy-prod.yaml @@ -0,0 +1,21 @@ +version: "3.4" + + +services: + certupdater: + image: mathwave/sprint-repo:setka + networks: + - common-infra-nginx + deploy: + mode: replicated + restart_policy: + condition: any + placement: + constraints: [node.labels.stage == production] + update_config: + parallelism: 1 + order: start-first + +networks: + common-infra-nginx: + external: true diff --git a/.gitea/workflows/deploy-dev.yaml b/.gitea/workflows/deploy-dev.yaml new file mode 100644 index 0000000..5b7568f --- /dev/null +++ b/.gitea/workflows/deploy-dev.yaml @@ -0,0 +1,41 @@ +name: Deploy Dev + +on: + pull_request: + branches: + - dev + types: [closed] + +jobs: + build: + name: Build + runs-on: [ dev ] + steps: + - name: login + run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }} + - name: checkout + uses: actions/checkout@v4 + with: + ref: dev + - name: build + run: docker build -t mathwave/sprint-repo:setka . + push: + name: Push + runs-on: [ dev ] + needs: build + steps: + - name: push + run: docker push mathwave/sprint-repo:setka + deploy-dev: + name: Deploy dev + runs-on: [prod] + needs: push + steps: + - name: login + run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }} + - name: checkout + uses: actions/checkout@v4 + with: + ref: dev + - name: deploy + run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml setka-development diff --git a/.gitea/workflows/deploy-prod.yaml b/.gitea/workflows/deploy-prod.yaml new file mode 100644 index 0000000..62bfe6f --- /dev/null +++ b/.gitea/workflows/deploy-prod.yaml @@ -0,0 +1,41 @@ +name: Deploy Prod + +on: + pull_request: + branches: + - prod + types: [closed] + +jobs: + build: + name: Build + runs-on: [ dev ] + steps: + - name: login + run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }} + - name: checkout + uses: actions/checkout@v4 + with: + ref: prod + - name: build + run: docker build -t mathwave/sprint-repo:setka . + push: + name: Push + runs-on: [ dev ] + needs: build + steps: + - name: push + run: docker push mathwave/sprint-repo:setka + deploy-prod: + name: Deploy prod + runs-on: [prod] + needs: push + steps: + - name: login + run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }} + - name: checkout + uses: actions/checkout@v4 + with: + ref: prod + - name: deploy + run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-prod.yaml setka diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..984afb1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx + +COPY index.html /nginx/index.html +COPY nginx.conf /etc/nginx/nginx.conf +EXPOSE 1238 \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..6b41db4 --- /dev/null +++ b/index.html @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..11585b8 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,13 @@ +http { + server { + listen 1238; + + root /nginx; + index index.html; + + location / { + try_files $uri $uri/ =404; + } + } +} +events {}