feat: added profiles to compose

This commit is contained in:
ITQ
2025-05-08 18:02:22 +03:00
parent 8fee526ba7
commit 5fd546ba5c
2 changed files with 31 additions and 18 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ deploy:
cd ~/deploy cd ~/deploy
docker compose pull --policy always -q > deploy.log 2>&1 docker compose pull --policy always -q > deploy.log 2>&1
docker compose up -d --remove-orphans --force-recreate >> deploy.log 2>&1 docker compose --profile celery --profile docs up -d --remove-orphans --force-recreate >> deploy.log 2>&1
docker compose ps >> deploy.log 2>&1 docker compose ps >> deploy.log 2>&1
nohup docker system prune -a --force >> deploy.log 2>&1 & nohup docker system prune -a --force >> deploy.log 2>&1 &
+23 -10
View File
@@ -90,7 +90,7 @@ services:
image: registry.gitlab.com/megazordpobeda/datarush/backend:${VERSION:-latest} image: registry.gitlab.com/megazordpobeda/datarush/backend:${VERSION:-latest}
build: build:
context: ./services/backend context: ./services/backend
command: celery -A config worker -l INFO command: [ "celery", "-A", "config", "worker", "-l", "INFO" ]
depends_on: depends_on:
redis: redis:
restart: false restart: false
@@ -104,10 +104,12 @@ services:
healthcheck: healthcheck:
test: [ "CMD", "celery", "-A", "config", "inspect", "ping" ] test: [ "CMD", "celery", "-A", "config", "inspect", "ping" ]
interval: 30s interval: 30s
timeout: 10s timeout: 30s
retries: 3 retries: 3
start_period: 10s start_period: 10s
start_interval: 2s start_interval: 2s
profiles:
- celery
restart: unless-stopped restart: unless-stopped
celery-exporter: celery-exporter:
@@ -122,6 +124,8 @@ services:
required: true required: true
- path: ./infrastructure/celery-exporter/.env - path: ./infrastructure/celery-exporter/.env
required: false required: false
profiles:
- monitoring
restart: unless-stopped restart: unless-stopped
frontend: frontend:
@@ -131,13 +135,6 @@ services:
required: true required: true
- path: ./infrastructure/frontend/.env - path: ./infrastructure/frontend/.env
required: false required: false
healthcheck:
test: ["CMD", "service", "nginx", "status", "||", " exit 1"]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
ports: ports:
- name: web - name: web
target: 80 target: 80
@@ -184,6 +181,8 @@ services:
required: true required: true
- path: ./infrastructure/redis-exporter/.env - path: ./infrastructure/redis-exporter/.env
required: false required: false
profiles:
- monitoring
restart: unless-stopped restart: unless-stopped
shm_size: 4mb shm_size: 4mb
@@ -198,7 +197,7 @@ services:
- path: ./infrastructure/postgres/.env - path: ./infrastructure/postgres/.env
required: false required: false
healthcheck: healthcheck:
test: ["CMD", "pg_isready"] test: [ "CMD", "pg_isready", "--dbname=$POSTGRES_DB" ]
interval: 1m30s interval: 1m30s
timeout: 5s timeout: 5s
start_period: 5s start_period: 5s
@@ -224,6 +223,8 @@ services:
required: true required: true
- path: ./infrastructure/postgres-exporter/.env - path: ./infrastructure/postgres-exporter/.env
required: false required: false
profiles:
- monitoring
restart: unless-stopped restart: unless-stopped
shm_size: 4mb shm_size: 4mb
@@ -256,6 +257,8 @@ services:
host_ip: 127.0.0.1 host_ip: 127.0.0.1
protocol: tcp protocol: tcp
app_protocol: http app_protocol: http
profiles:
- administrative
restart: unless-stopped restart: unless-stopped
secrets: secrets:
- source: pgadmin_password - source: pgadmin_password
@@ -289,6 +292,8 @@ services:
host_ip: 127.0.0.1 host_ip: 127.0.0.1
protocol: tcp protocol: tcp
app_protocol: http app_protocol: http
profiles:
- monitoring
restart: unless-stopped restart: unless-stopped
shm_size: 4mb shm_size: 4mb
volumes: volumes:
@@ -357,6 +362,8 @@ services:
host_ip: 127.0.0.1 host_ip: 127.0.0.1
protocol: tcp protocol: tcp
app_protocol: http app_protocol: http
profiles:
- monitoring
restart: unless-stopped restart: unless-stopped
shm_size: 4mb shm_size: 4mb
volumes: volumes:
@@ -376,11 +383,15 @@ services:
host_ip: 127.0.0.1 host_ip: 127.0.0.1
protocol: tcp protocol: tcp
app_protocol: http app_protocol: http
profiles:
- docs
restart: unless-stopped restart: unless-stopped
shm_size: 4mb shm_size: 4mb
custom_python: custom_python:
image: registry.gitlab.com/megazordpobeda/datarush/custom-python:${VERSION:-latest} image: registry.gitlab.com/megazordpobeda/datarush/custom-python:${VERSION:-latest}
profiles:
- celery
checker: checker:
image: registry.gitlab.com/megazordpobeda/datarush/checker:${VERSION:-latest} image: registry.gitlab.com/megazordpobeda/datarush/checker:${VERSION:-latest}
@@ -404,6 +415,8 @@ services:
host_ip: 127.0.0.1 host_ip: 127.0.0.1
protocol: tcp protocol: tcp
app_protocol: http app_protocol: http
profiles:
- celery
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- type: bind - type: bind