feat(docker_compose): added profiles to compose.yaml
also refactored it a lil bit
This commit is contained in:
+45
-9
@@ -5,6 +5,9 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./services/backend
|
context: ./services/backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
tags:
|
||||||
|
- adnova-backend:latest
|
||||||
|
pull: true
|
||||||
depends_on:
|
depends_on:
|
||||||
backend-initdb:
|
backend-initdb:
|
||||||
restart: false
|
restart: false
|
||||||
@@ -30,16 +33,20 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- name: web
|
- name: web
|
||||||
target: 8080
|
target: 8080
|
||||||
published: 8080
|
published: 13240
|
||||||
host_ip: 127.0.0.1
|
host_ip: 127.0.0.1
|
||||||
protocol: tcp
|
protocol: tcp
|
||||||
app_protocol: http
|
app_protocol: http
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
backend-initdb:
|
backend-initdb:
|
||||||
build:
|
build:
|
||||||
context: ./services/backend
|
context: ./services/backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
tags:
|
||||||
|
- adnova-backend:latest
|
||||||
|
pull: true
|
||||||
command: ./scripts/initdb
|
command: ./scripts/initdb
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -59,18 +66,22 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: ./infrastructure/backend/.env
|
- path: ./infrastructure/backend/.env
|
||||||
required: false
|
required: false
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
backend-staticfiles:
|
backend-staticfiles:
|
||||||
build:
|
build:
|
||||||
context: ./services/backend
|
context: ./services/backend
|
||||||
dockerfile: Dockerfile.staticfiles
|
dockerfile: Dockerfile.staticfiles
|
||||||
|
tags:
|
||||||
|
- adnova-backend-staticfiles:latest
|
||||||
|
pull: true
|
||||||
env_file:
|
env_file:
|
||||||
- path: ./infrastructure/backend/.env.template
|
- path: ./infrastructure/backend/.env.template
|
||||||
required: true
|
required: true
|
||||||
- path: ./infrastructure/backend/.env
|
- path: ./infrastructure/backend/.env
|
||||||
required: false
|
required: false
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "service", "nginx", "status", "||", " exit 1"]
|
test: ["CMD-SHELL", "nginx", "-t", "||", "exit 1"]
|
||||||
interval: 1m30s
|
interval: 1m30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
start_period: 5s
|
start_period: 5s
|
||||||
@@ -84,11 +95,15 @@ services:
|
|||||||
protocol: tcp
|
protocol: tcp
|
||||||
app_protocol: http
|
app_protocol: http
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
backend-celery-worker:
|
backend-celery-worker:
|
||||||
build:
|
build:
|
||||||
context: ./services/backend
|
context: ./services/backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
tags:
|
||||||
|
- adnova-backend:latest
|
||||||
|
pull: true
|
||||||
command: celery -A config worker -l INFO
|
command: celery -A config worker -l INFO
|
||||||
depends_on:
|
depends_on:
|
||||||
redis:
|
redis:
|
||||||
@@ -108,6 +123,7 @@ services:
|
|||||||
start_period: 10s
|
start_period: 10s
|
||||||
start_interval: 2s
|
start_interval: 2s
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
celery-exporter:
|
celery-exporter:
|
||||||
image: docker.io/danihodovic/celery-exporter:0.12.2
|
image: docker.io/danihodovic/celery-exporter:0.12.2
|
||||||
@@ -122,7 +138,10 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: ./infrastructure/celery-exporter/.env
|
- path: ./infrastructure/celery-exporter/.env
|
||||||
required: false
|
required: false
|
||||||
|
profiles:
|
||||||
|
- observability
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
telegram_bot:
|
telegram_bot:
|
||||||
build:
|
build:
|
||||||
@@ -130,6 +149,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
tags:
|
tags:
|
||||||
- adnova-telegram_bot:latest
|
- adnova-telegram_bot:latest
|
||||||
|
pull: true
|
||||||
depends_on:
|
depends_on:
|
||||||
backend:
|
backend:
|
||||||
restart: false
|
restart: false
|
||||||
@@ -148,7 +168,10 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: ./infrastructure/telegram_bot/.env
|
- path: ./infrastructure/telegram_bot/.env
|
||||||
required: false
|
required: false
|
||||||
|
profiles:
|
||||||
|
- telegram_bot
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: docker.io/redis:7-alpine3.21
|
image: docker.io/redis:7-alpine3.21
|
||||||
@@ -187,6 +210,8 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: ./infrastructure/redis-exporter/.env
|
- path: ./infrastructure/redis-exporter/.env
|
||||||
required: false
|
required: false
|
||||||
|
profiles:
|
||||||
|
- observability
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
shm_size: 4mb
|
shm_size: 4mb
|
||||||
|
|
||||||
@@ -230,6 +255,8 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: ./infrastructure/postgres-exporter/.env
|
- path: ./infrastructure/postgres-exporter/.env
|
||||||
required: false
|
required: false
|
||||||
|
profiles:
|
||||||
|
- observability
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
shm_size: 4mb
|
shm_size: 4mb
|
||||||
|
|
||||||
@@ -262,6 +289,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:
|
||||||
|
- observability
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
secrets:
|
secrets:
|
||||||
- source: pgadmin_password
|
- source: pgadmin_password
|
||||||
@@ -274,10 +303,10 @@ services:
|
|||||||
|
|
||||||
grafana:
|
grafana:
|
||||||
image: docker.io/grafana/grafana-oss:12.0.2
|
image: docker.io/grafana/grafana-oss:12.0.2
|
||||||
|
entrypoint: ["/etc/grafana/scripts/entrypoint.sh"]
|
||||||
configs:
|
configs:
|
||||||
- source: grafana_config
|
- source: grafana_config
|
||||||
target: /usr/share/grafana/conf/defaults.ini
|
target: /usr/share/grafana/conf/defaults.ini
|
||||||
entrypoint: ["/etc/grafana/scripts/entrypoint.sh"]
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "-O", "-", "http://localhost:3000/api/health"]
|
test: ["CMD", "wget", "-O", "-", "http://localhost:3000/api/health"]
|
||||||
interval: 1m30s
|
interval: 1m30s
|
||||||
@@ -292,6 +321,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:
|
||||||
|
- observability
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
shm_size: 4mb
|
shm_size: 4mb
|
||||||
volumes:
|
volumes:
|
||||||
@@ -325,6 +356,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:
|
||||||
|
- observability
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
shm_size: 4mb
|
shm_size: 4mb
|
||||||
volumes:
|
volumes:
|
||||||
@@ -361,6 +394,7 @@ services:
|
|||||||
protocol: tcp
|
protocol: tcp
|
||||||
app_protocol: http
|
app_protocol: http
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
volumes:
|
volumes:
|
||||||
- type: volume
|
- type: volume
|
||||||
source: minio_data
|
source: minio_data
|
||||||
@@ -382,18 +416,17 @@ services:
|
|||||||
host_ip: 127.0.0.1
|
host_ip: 127.0.0.1
|
||||||
protocol: tcp
|
protocol: tcp
|
||||||
app_protocol: http
|
app_protocol: http
|
||||||
- name: api
|
profiles:
|
||||||
target: 9411
|
- observability
|
||||||
published: 13247
|
|
||||||
host_ip: 127.0.0.1
|
|
||||||
protocol: tcp
|
|
||||||
app_protocol: http
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
loadtest:
|
loadtest:
|
||||||
build:
|
build:
|
||||||
context: ./services/loadtest
|
context: ./services/loadtest
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
tags:
|
||||||
|
- adnova-loadtest:latest
|
||||||
depends_on:
|
depends_on:
|
||||||
backend:
|
backend:
|
||||||
restart: false
|
restart: false
|
||||||
@@ -411,7 +444,10 @@ services:
|
|||||||
host_ip: 127.0.0.1
|
host_ip: 127.0.0.1
|
||||||
protocol: tcp
|
protocol: tcp
|
||||||
app_protocol: http
|
app_protocol: http
|
||||||
|
profiles:
|
||||||
|
- loadtest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
shm_size: 4mb
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
redis_data:
|
redis_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user