184 lines
4.1 KiB
YAML
184 lines
4.1 KiB
YAML
version: "3.6"
|
|
|
|
services:
|
|
|
|
nginx:
|
|
image: mathwave/sprint-repo:sprint-infra-nginx-prod
|
|
networks:
|
|
- common-infra-nginx
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
deploy:
|
|
mode: replicated
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
postgres:
|
|
image: postgres:14-alpine3.19
|
|
volumes:
|
|
- /sprint-data/postgres-data:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_PASSWORD: $DB_PASSWORD_PROD
|
|
healthcheck:
|
|
test: pg_isready || pg_resetwal /var/lib/postgresql/data
|
|
interval: 60s
|
|
retries: 5
|
|
start_period: 20s
|
|
timeout: 10s
|
|
ports:
|
|
- "5432:5432"
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: any
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
resources:
|
|
limits:
|
|
cpus: '1.0'
|
|
reservations:
|
|
cpus: '0.50'
|
|
|
|
mongo:
|
|
image: mongo:6.0.2
|
|
volumes:
|
|
- /sprint-data/mongo:/data/db
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: mongo
|
|
MONGO_INITDB_ROOT_PASSWORD: $MONGO_PASSWORD_PROD
|
|
ports:
|
|
- "27017:27017"
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: any
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
rabbitmq:
|
|
image: rabbitmq:3.10.7-management
|
|
volumes:
|
|
- /sprint-data/rabbitmq:/var/lib/rabbitmq
|
|
ports:
|
|
- "5672:5672"
|
|
- "15672:15672"
|
|
environment:
|
|
RABBITMQ_DEFAULT_PASS: $RABBITMQ_PASSWORD_PROD
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: any
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
redis:
|
|
image: redis:alpine3.16
|
|
volumes:
|
|
- /sprint-data/redis:/data
|
|
ports:
|
|
- "6379:6379"
|
|
command: redis-server --requirepass $REDIS_PASSWORD_PROD
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: any
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
minio:
|
|
image: bitnami/minio:2022.10.8
|
|
volumes:
|
|
- minio_data:/data
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
MINIO_ROOT_PASSWORD: $MINIO_PASSWORD_PROD
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
deploy:
|
|
mode: replicated
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
restart_policy:
|
|
condition: any
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
gitea:
|
|
image: gitea/gitea:1.22.3
|
|
volumes:
|
|
- /sprint-data/gitea:/data
|
|
- /etc/timezone:/etc/timezone
|
|
- /etc/localtime:/etc/localtime
|
|
ports:
|
|
- "3000:3000"
|
|
- "222:22"
|
|
environment:
|
|
USER_UID: 1000
|
|
USER_GID: 1000
|
|
GITEA__database__DB_TYPE: postgres
|
|
GITEA__database__HOST: pg.sprinthub.ru:5432
|
|
GITEA__database__NAME: gitea
|
|
GITEA__database__USER: postgres
|
|
GITEA__database__PASSWD: $DB_PASSWORD_PROD
|
|
deploy:
|
|
mode: replicated
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
restart_policy:
|
|
condition: any
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
gitea-runner:
|
|
image: mathwave/sprint-repo:gitea-runner
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /sprint-data:/sprint-data
|
|
environment:
|
|
GITEA_INSTANCE_URL: https://gitea.sprinthub.ru/
|
|
GITEA_RUNNER_REGISTRATION_TOKEN: $REGISTRATION_TOKEN
|
|
GITEA_RUNNER_NAME: prod
|
|
GITEA_RUNNER_LABELS: prod
|
|
deploy:
|
|
mode: replicated
|
|
placement:
|
|
constraints: [node.role == manager]
|
|
restart_policy:
|
|
condition: any
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
volumes:
|
|
minio_data:
|
|
driver: local
|
|
gitea:
|
|
|
|
|
|
networks:
|
|
net:
|
|
driver: overlay
|
|
common-infra-nginx:
|
|
external: true |