This commit is contained in:
emmatveev 2024-11-23 11:03:25 +03:00
parent d3c3047142
commit a511909fe6
10 changed files with 24 additions and 141 deletions

View File

@ -15,7 +15,7 @@ services:
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == development]
update_config:
parallelism: 1
order: start-first
@ -39,7 +39,7 @@ services:
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == development]
update_config:
parallelism: 1
order: start-first
@ -58,7 +58,7 @@ services:
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == development]
update_config:
parallelism: 1
order: start-first
@ -77,7 +77,7 @@ services:
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == development]
update_config:
parallelism: 1
order: start-first
@ -94,7 +94,7 @@ services:
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == development]
update_config:
parallelism: 1
order: start-first
@ -112,7 +112,7 @@ services:
deploy:
mode: replicated
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == development]
restart_policy:
condition: any
update_config:
@ -132,7 +132,7 @@ services:
deploy:
mode: replicated
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == development]
restart_policy:
condition: any
update_config:

View File

@ -1,39 +0,0 @@
version: '3.2'
services:
agent:
image: portainer/agent:2.11.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
- agent_network
deploy:
mode: global
placement:
constraints: [node.platform.os == linux]
portainer:
image: portainer/portainer-ce:2.11.1
command: -H tcp://tasks.agent:9001 --tlsskipverify
ports:
- "9443:9443"
- "8888:9000"
- "8000:8000"
volumes:
- portainer_data:/data
networks:
- agent_network
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
networks:
agent_network:
driver: overlay
attachable: true
volumes:
portainer_data:

View File

@ -28,7 +28,7 @@ services:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
constraints: [node.labels.stage == production]
networks:
agent_network:

View File

@ -1,71 +0,0 @@
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
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 60s
timeout: 10s
retries: 3
networks:
- net
ports:
- "888:8080"
deploy:
resources:
limits:
memory: 1024M
reservations:
memory: 512M
placement:
constraints:
- node.role == manager
db:
image: treehouses/couchdb:2.3.1
networks:
- net
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 128M
influxdb:
image: influxdb:1.7
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

View File

@ -24,8 +24,8 @@ services:
reservations:
memory: 512M
placement:
constraints:
- node.role == manager
constraints: [node.labels.stage == production]
db:
image: treehouses/couchdb:2.3.1
networks:

View File

@ -42,11 +42,7 @@ jobs:
with:
ref: dev
- name: prepare
run: chmod 777 ./run.sh && ./run.sh
- name: deploy swarmpit
run: docker stack deploy --with-registry-auth -c ./.deploy-swarmpit/deploy-dev.yaml swarmpit
- name: deploy portainer
run: docker stack deploy --with-registry-auth -c ./.deploy-portainer/deploy-dev.yaml portainer
run: chmod 777 ./prepare/run-development.sh && ./prepare/run-development.sh
- name: deploy infra
env:
MONGO_PASSWORD_DEV: ${{ secrets.MONGO_PASSWORD_DEV }}
@ -55,4 +51,4 @@ jobs:
REDIS_PASSWORD_DEV: ${{ secrets.REDIS_PASSWORD_DEV }}
RABBITMQ_PASSWORD_DEV: ${{ secrets.RABBITMQ_PASSWORD_DEV }}
REGISTRATION_TOKEN: ${{ secrets.REGISTRATION_TOKEN }}
run: docker stack deploy --with-registry-auth -c ./.deploy-infra/deploy-dev.yaml infra
run: docker stack deploy --with-registry-auth -c ./.deploy-infra/deploy-dev.yaml infra-development

View File

@ -42,7 +42,7 @@ jobs:
with:
ref: prod
- name: prepare
run: chmod 777 ./run.sh && ./run.sh
run: chmod 777 ./prepare/run-production.sh && ./prepare/run-production.sh
- name: deploy swarmpit
run: docker stack deploy --with-registry-auth -c ./.deploy-swarmpit/deploy-prod.yaml swarmpit
- name: deploy portainer

View File

@ -1,14 +0,0 @@
FROM gitlab/gitlab-runner
RUN apt-get update
RUN apt-get install --yes ca-certificates curl gnupg lsb-release
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update --yes
RUN apt-get install --yes docker-ce docker-ce-cli containerd.io docker-compose-plugin
RUN mkdir /etc/builds/
RUN chmod 777 /etc/builds

View File

@ -0,0 +1,11 @@
docker login -u mathwave -p $DOCKERHUB_PASSWORD
docker network create -d overlay --attachable common-infra-nginx-development || true
docker network create -d overlay --attachable queues-development || true
mkdir /sprint-data/mongo || true
mkdir /sprint-data/redis || true
mkdir /sprint-data/rabbitmq || true
mkdir /sprint-data/certs || true
mkdir /sprint-data/gitea || true
chmod 777 /sprint-data/redis
chmod 777 /sprint-data/rabbitmq
chmod 777 /sprint-data/gitea