This commit is contained in:
Administrator 2022-08-31 22:47:22 +03:00
parent 290da7f786
commit c7044db800
8 changed files with 182 additions and 5 deletions

View File

View File

@ -9,6 +9,7 @@ services:
networks:
- battleship-nginx
- sprint-nginx
- swarmpit-nginx
deploy:
mode: replicated
replicas: 1
@ -113,4 +114,6 @@ networks:
battleship-nginx:
external: true
sprint-nginx:
external: true
swarmpit-nginx:
external: true

View File

@ -9,6 +9,7 @@ services:
networks:
- battleship-nginx
- sprint-nginx
- swarmpit-nginx
deploy:
mode: replicated
replicas: 2
@ -113,4 +114,6 @@ networks:
battleship-nginx:
external: true
sprint-nginx:
external: true
swarmpit-nginx:
external: true

View File

@ -0,0 +1,84 @@
version: '3.3'
services:
app:
image: swarmpit/swarmpit:latest
environment:
- SWARMPIT_DB=http://db:5984
- SWARMPIT_INFLUXDB=http://influxdb:8086
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 888:8080
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 60s
timeout: 10s
retries: 3
networks:
- net
- swarmpit-nginx
deploy:
resources:
limits:
memory: 1024M
reservations:
memory: 512M
placement:
constraints:
- node.role == manager
db:
image: treehouses/couchdb:2.3.1
volumes:
- db-data:/opt/couchdb/data
networks:
- net
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 128M
influxdb:
image: influxdb:1.7
volumes:
- influx-data:/var/lib/influxdb
networks:
- net
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 128M
agent:
image: swarmpit/agent:latest
environment:
- DOCKER_API_VERSION=1.35
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- net
deploy:
mode: global
labels:
swarmpit.agent: 'true'
resources:
limits:
memory: 64M
reservations:
memory: 32M
networks:
net:
driver: overlay
swarmpit-nginx:
external: true
volumes:
db-data:
driver: local
influx-data:
driver: local

View File

@ -0,0 +1,84 @@
version: '3.3'
services:
app:
image: swarmpit/swarmpit:latest
environment:
- SWARMPIT_DB=http://db:5984
- SWARMPIT_INFLUXDB=http://influxdb:8086
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 888:8080
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 60s
timeout: 10s
retries: 3
networks:
- net
- swarmpit-nginx
deploy:
resources:
limits:
memory: 1024M
reservations:
memory: 512M
placement:
constraints:
- node.role == manager
db:
image: treehouses/couchdb:2.3.1
volumes:
- db-data:/opt/couchdb/data
networks:
- net
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 128M
influxdb:
image: influxdb:1.7
volumes:
- influx-data:/var/lib/influxdb
networks:
- net
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 128M
agent:
image: swarmpit/agent:latest
environment:
- DOCKER_API_VERSION=1.35
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- net
deploy:
mode: global
labels:
swarmpit.agent: 'true'
resources:
limits:
memory: 64M
reservations:
memory: 32M
networks:
net:
driver: overlay
swarmpit-nginx:
external: true
volumes:
db-data:
driver: local
influx-data:
driver: local

View File

@ -6,13 +6,14 @@ stages:
.deploy:
before_script:
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
- docker network create -d overlay --attachable swarmpit-nginx || true
build:
stage: build
extends:
- .deploy
tags:
- dev
before_script:
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
script:
- docker build -t mathwave/sprint-repo:sprint-infra-nginx-dev nginx/nginx-dev
- docker push mathwave/sprint-repo:sprint-infra-nginx-dev
@ -30,7 +31,8 @@ deploy-dev:
when: on_success
- when: manual
script:
- docker stack deploy -c ./.deploy/deploy-dev.yaml infra
- docker stack deploy -c ./.deploy-swarmpit/deploy-dev.yaml swarmpit
- docker stack deploy -c ./.deploy-infra/deploy-dev.yaml infra
deploy-prod:
stage: deploy-prod
@ -42,4 +44,5 @@ deploy-prod:
- master
when: manual
script:
- docker stack deploy -c ./.deploy-swarmpit/deploy-prod.yaml swarmpit
- docker stack deploy -c ./.deploy/deploy-prod.yaml infra

View File

@ -8,7 +8,7 @@ http {
server_name swarmpit.develop.sprinthub.ru;
location / {
proxy_pass http://dev.develop.sprinthub.ru:888/;
proxy_pass http://app:8080/;
}
}

View File

@ -17,7 +17,7 @@ http {
server_name swarmpit.sprinthub.ru;
location / {
proxy_pass http://dev.sprinthub.ru:888/;
proxy_pass http://app:8080/;
}
}