init: added template
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ./src/backend
|
||||
dockerfile: Containerfile
|
||||
tags:
|
||||
- lotty-backend:latest
|
||||
pull: true
|
||||
depends_on:
|
||||
backend-initdb:
|
||||
restart: false
|
||||
condition: service_completed_successfully
|
||||
required: true
|
||||
postgresql:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
valkey:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/backend/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/backend/.env
|
||||
required: false
|
||||
ports:
|
||||
- name: web
|
||||
target: 8080
|
||||
published: ${DJANGO_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
networks:
|
||||
- default
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
backend-initdb:
|
||||
build:
|
||||
context: ./src/backend
|
||||
dockerfile: Containerfile
|
||||
tags:
|
||||
- lotty-backend:latest
|
||||
pull: true
|
||||
entrypoint: ./scripts/initdb
|
||||
depends_on:
|
||||
postgresql:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
valkey:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/backend/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/backend/.env
|
||||
required: false
|
||||
networks:
|
||||
- default
|
||||
restart: no
|
||||
shm_size: 4mb
|
||||
|
||||
backend-staticfiles:
|
||||
build:
|
||||
context: ./src/backend
|
||||
dockerfile: Containerfile.staticfiles
|
||||
tags:
|
||||
- lotty-backend-staticfiles:latest
|
||||
pull: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/backend/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/backend/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "nginx", "-t", "||", "exit 1"]
|
||||
interval: 1m30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 5
|
||||
ports:
|
||||
- name: web
|
||||
target: 80
|
||||
published: ${DJANGO_STATICFILES_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
networks:
|
||||
- default
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
backend-celery-worker:
|
||||
build:
|
||||
context: ./src/backend
|
||||
dockerfile: Containerfile
|
||||
tags:
|
||||
- lotty-backend:latest
|
||||
pull: true
|
||||
command: celery -A config worker -l INFO
|
||||
depends_on:
|
||||
valkey:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/backend/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/backend/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD", "celery", "-A", "config", "inspect", "ping"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
start_interval: 2s
|
||||
networks:
|
||||
- default
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
celery-exporter:
|
||||
image: docker.io/danihodovic/celery-exporter:latest
|
||||
command:
|
||||
- --retry-interval=5
|
||||
depends_on:
|
||||
valkey:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/celery-exporter/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/celery-exporter/.env
|
||||
required: false
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
@@ -0,0 +1,297 @@
|
||||
services:
|
||||
grafana:
|
||||
image: docker.io/grafana/grafana-oss:12.3.2
|
||||
entrypoint:
|
||||
- /etc/grafana/scripts/entrypoint.sh
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/grafana/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/grafana/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-O", "-", "http://localhost:3000/api/health"]
|
||||
interval: 1m30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 5
|
||||
ports:
|
||||
- name: web
|
||||
target: 3000
|
||||
published: ${GRAFANA_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./infrastructure/configs/grafana/provisioning
|
||||
target: /etc/grafana/provisioning
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ./infrastructure/configs/grafana/scripts
|
||||
target: /etc/grafana/scripts
|
||||
read_only: true
|
||||
|
||||
otel-collector:
|
||||
image: docker.io/otel/opentelemetry-collector-contrib:latest
|
||||
command:
|
||||
- --config=/etc/otelcol-contrib/config.yaml
|
||||
configs:
|
||||
- source: otel_collector_config
|
||||
target: /etc/otelcol-contrib/config.yaml
|
||||
ports:
|
||||
- name: otlp-grpc
|
||||
target: 4317
|
||||
published: ${OTEL_GRPC_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
- name: otlp-http
|
||||
target: 4318
|
||||
published: ${OTEL_HTTP_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
grafana-loki:
|
||||
image: docker.io/grafana/loki:3.6.5
|
||||
command:
|
||||
- --config.file=/etc/loki/local-config.yaml
|
||||
- --config.expand-env=true
|
||||
depends_on:
|
||||
s3:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
configs:
|
||||
- source: grafana_loki_config
|
||||
target: /etc/loki/local-config.yaml
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/s3/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/s3/.env
|
||||
required: false
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
grafana-tempo:
|
||||
image: docker.io/grafana/tempo:2.10.0
|
||||
command:
|
||||
- --config.file=/etc/tempo/tempo-config.yaml
|
||||
- --config.expand-env=true
|
||||
depends_on:
|
||||
s3:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
configs:
|
||||
- source: grafana_tempo_config
|
||||
target: /etc/tempo/tempo-config.yaml
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/s3/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/s3/.env
|
||||
required: false
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
grafana-pyroscope:
|
||||
image: docker.io/grafana/pyroscope:1.18.0
|
||||
command:
|
||||
- -config.file=/etc/pyroscope/config.yaml
|
||||
- -config.expand-env=true
|
||||
depends_on:
|
||||
s3:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
configs:
|
||||
- source: grafana_pyroscope_config
|
||||
target: /etc/pyroscope/config.yaml
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/s3/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/s3/.env
|
||||
required: false
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
vmagent:
|
||||
image: docker.io/victoriametrics/vmagent:v1.135.0
|
||||
command:
|
||||
- -promscrape.config=/etc/vmagent/scrape.yaml
|
||||
- -remoteWrite.url=http://victoriametrics:8428/api/v1/write
|
||||
configs:
|
||||
- source: vmagent_config
|
||||
target: /etc/vmagent/scrape.yaml
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
victoriametrics:
|
||||
image: docker.io/victoriametrics/victoria-metrics:v1.134.0
|
||||
command:
|
||||
- -storageDataPath=/var/lib/victoriametrics
|
||||
- -retentionPeriod=30d
|
||||
- -httpListenAddr=:8428
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8428/-/healthy"]
|
||||
interval: 1m30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 5
|
||||
ports:
|
||||
- name: web
|
||||
target: 8428
|
||||
published: ${VICTORIAMETRICS_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
volumes:
|
||||
- type: volume
|
||||
source: victoriametrics_data
|
||||
target: /var/lib/victoriametrics
|
||||
read_only: false
|
||||
|
||||
redis-exporter:
|
||||
image: docker.io/oliver006/redis_exporter:v1.80.2-alpine
|
||||
depends_on:
|
||||
valkey:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/redis-exporter/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/redis-exporter/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-O", "-", "http://localhost:9121/metrics"]
|
||||
interval: 1m30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 5
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
postgres-exporter:
|
||||
image: quay.io/prometheuscommunity/postgres-exporter:latest
|
||||
depends_on:
|
||||
postgresql:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/postgres-exporter/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/postgres-exporter/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-O", "-", "http://localhost:9187/metrics"]
|
||||
interval: 1m30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 5
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
|
||||
pgadmin:
|
||||
image: docker.io/dpage/pgadmin4:9
|
||||
configs:
|
||||
- source: pgadmin_servers_config
|
||||
target: /pgadmin4/servers.json
|
||||
depends_on:
|
||||
postgresql:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/pgadmin/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/pgadmin/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-O", "-", "http://localhost:80/misc/ping"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 5
|
||||
ports:
|
||||
- name: web
|
||||
target: 80
|
||||
published: ${PGADMIN_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
networks:
|
||||
- default
|
||||
profiles:
|
||||
- observability
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
volumes:
|
||||
- type: volume
|
||||
source: pgadmin_data
|
||||
target: /var/lib/pgadmin
|
||||
read_only: false
|
||||
|
||||
volumes:
|
||||
victoriametrics_data:
|
||||
pgadmin_data:
|
||||
|
||||
configs:
|
||||
otel_collector_config:
|
||||
file: ./infrastructure/configs/otel-collector/config.yaml
|
||||
grafana_loki_config:
|
||||
file: ./infrastructure/configs/grafana-loki/loki.yaml
|
||||
grafana_tempo_config:
|
||||
file: ./infrastructure/configs/grafana-tempo/tempo.yaml
|
||||
grafana_pyroscope_config:
|
||||
file: ./infrastructure/configs/grafana-pyroscope/config.yaml
|
||||
vmagent_config:
|
||||
file: ./infrastructure/configs/victoriametrics/vmagent.yaml
|
||||
pgadmin_servers_config:
|
||||
file: ./infrastructure/configs/pgadmin/servers.json
|
||||
@@ -0,0 +1,141 @@
|
||||
services:
|
||||
postgresql:
|
||||
image: docker.io/postgres:18-alpine
|
||||
configs:
|
||||
- source: postgresql_config
|
||||
target: /etc/postgresql/postgresql.conf
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/postgresql/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/postgresql/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD", "sh", "-c", "pg_isready -U postgres -d postgres"]
|
||||
interval: 1m30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 5
|
||||
networks:
|
||||
- default
|
||||
oom_kill_disable: true
|
||||
restart: unless-stopped
|
||||
shm_size: 128mb
|
||||
volumes:
|
||||
- type: volume
|
||||
source: postgresql_data
|
||||
target: /var/lib/postgresql/data
|
||||
|
||||
valkey:
|
||||
image: docker.io/valkey/valkey:9-alpine
|
||||
command: valkey-server /usr/local/etc/valkey/valkey.conf
|
||||
configs:
|
||||
- source: valkey_config
|
||||
target: /usr/local/etc/valkey/valkey.conf
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/valkey/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/valkey/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD", "sh", "-c", "valkey-cli -p 6379 --pass valkey ping | grep PONG"]
|
||||
interval: 10s
|
||||
timeout: 2s
|
||||
start_period: 5s
|
||||
start_interval: 2s
|
||||
retries: 3
|
||||
networks:
|
||||
- default
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
volumes:
|
||||
- type: volume
|
||||
source: valkey_data
|
||||
target: /data
|
||||
read_only: false
|
||||
|
||||
s3:
|
||||
image: docker.io/rustfs/rustfs:1.0.0-alpha.82
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/rustfs/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/rustfs/.env
|
||||
required: false
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"sh",
|
||||
"-c",
|
||||
"curl -f http://localhost:9000/health && curl -f http://localhost:9001/rustfs/console/health",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
start_period: 5s
|
||||
start_interval: 5s
|
||||
retries: 3
|
||||
ports:
|
||||
- name: api
|
||||
target: 9000
|
||||
published: ${RUSTFS_API_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
- name: console
|
||||
target: 9001
|
||||
published: ${RUSTFS_CONSOLE_PORT}
|
||||
host_ip: 127.0.0.1
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
networks:
|
||||
- default
|
||||
restart: unless-stopped
|
||||
shm_size: 4mb
|
||||
volumes:
|
||||
- type: volume
|
||||
source: rustfs_data
|
||||
target: /data
|
||||
|
||||
s3-init:
|
||||
image: docker.io/minio/mc:latest
|
||||
entrypoint: >
|
||||
sh -c "until mc alias set default $$S3_URL $$S3_ACCESS_KEY $$S3_SECRET_KEY; do sleep 1; done &&
|
||||
mc mb default/loki;
|
||||
mc mb default/tempo;
|
||||
mc mb default/pyroscope;
|
||||
mc policy set public default/loki; true"
|
||||
depends_on:
|
||||
s3:
|
||||
restart: false
|
||||
condition: service_healthy
|
||||
required: true
|
||||
env_file:
|
||||
- path: ./infrastructure/configs/s3/.env.template
|
||||
required: true
|
||||
- path: ./infrastructure/configs/s3/.env
|
||||
required: false
|
||||
networks:
|
||||
- default
|
||||
restart: no
|
||||
shm_size: 4mb
|
||||
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
name: $COMPOSE_PROJECT_NAME
|
||||
attachable: false
|
||||
enable_ipv4: true
|
||||
enable_ipv6: true
|
||||
internal: false
|
||||
|
||||
volumes:
|
||||
postgresql_data:
|
||||
valkey_data:
|
||||
rustfs_data:
|
||||
|
||||
configs:
|
||||
postgresql_config:
|
||||
file: ./infrastructure/configs/postgresql/postgresql.conf
|
||||
valkey_config:
|
||||
file: ./infrastructure/configs/valkey/valkey.conf
|
||||
Reference in New Issue
Block a user