Files
Datarush/compose.yaml
T
2025-12-17 17:49:38 +03:00

348 lines
7.8 KiB
YAML

name: datarush
services:
gw:
build:
context: .
dockerfile: Containerfile
args:
SERVICE: gw
depends_on:
migrate:
restart: false
condition: service_completed_successfully
required: true
postgres:
restart: false
condition: service_healthy
required: true
redis:
restart: false
condition: service_healthy
required: true
auth:
restart: false
condition: service_started
required: true
competition:
restart: false
condition: service_started
required: true
task:
restart: false
condition: service_started
required: true
env_file:
- path: ./infrastructure/gw/.env.template
required: true
- path: ./infrastructure/gw/.env
required: false
networks:
- default
restart: unless-stopped
shm_size: 4mb
migrate:
build:
context: .
dockerfile: Containerfile
args:
SERVICE: migrate
depends_on:
postgres:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/migrate/.env.template
required: true
- path: ./infrastructure/migrate/.env
required: false
networks:
- default
restart: no
shm_size: 4mb
auth:
build:
context: .
dockerfile: Containerfile
args:
SERVICE: auth
depends_on:
postgres:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/auth/.env.template
required: true
- path: ./infrastructure/auth/.env
required: false
networks:
- default
restart: unless-stopped
shm_size: 4mb
competition:
build:
context: .
dockerfile: Containerfile
args:
SERVICE: competition
depends_on:
postgres:
restart: false
condition: service_healthy
required: true
redis:
restart: false
condition: service_healthy
required: true
auth:
restart: false
condition: service_started
required: true
env_file:
- path: ./infrastructure/competition/.env.template
required: true
- path: ./infrastructure/competition/.env
required: false
networks:
- default
restart: unless-stopped
shm_size: 4mb
task:
build:
context: .
dockerfile: Containerfile
args:
SERVICE: task
depends_on:
postgres:
restart: false
condition: service_healthy
required: true
redis:
restart: false
condition: service_healthy
required: true
auth:
restart: false
condition: service_started
required: true
env_file:
- path: ./infrastructure/task/.env.template
required: true
- path: ./infrastructure/task/.env
required: false
networks:
- default
restart: unless-stopped
shm_size: 4mb
nginx:
image: docker.io/nginx:1.29-alpine
configs:
- source: nginx_config
target: /etc/nginx/nginx.conf
depends_on:
gw:
restart: false
condition: service_started
required: true
healthcheck:
test: ["CMD", "wget", "-O", "-", "http://localhost:80/healthz"]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
ports:
- name: web
target: 80
published: 8080
host_ip: 0.0.0.0
protocol: tcp
app_protocol: http
networks:
- default
restart: unless-stopped
shm_size: 4mb
postgres:
image: docker.io/postgres:17-alpine
configs:
- source: postgres_config
target: /etc/postgresql/postgresql.conf
env_file:
- path: ./infrastructure/postgres/.env.template
required: true
- path: ./infrastructure/postgres/.env
required: false
healthcheck:
test: ["CMD", "pg_isready", "--dbname=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: postgres_data
target: /var/lib/postgresql/data
pgadmin:
image: docker.io/dpage/pgadmin4:9
configs:
- source: pgadmin_servers_config
target: /pgadmin4/servers.json
depends_on:
postgres:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/pgadmin/.env.template
required: true
- path: ./infrastructure/pgadmin/.env
required: false
healthcheck:
test: ["CMD", "wget", "-O", "-", "http://localhost:80/misc/ping"]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
ports:
- name: web
target: 80
published: 13442
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
redis:
image: docker.io/redis:8-alpine
command: redis-server /usr/local/etc/redis/redis.conf
configs:
- source: redis_config
target: /usr/local/etc/redis/redis.conf
env_file:
- path: ./infrastructure/redis/.env.template
required: true
- path: ./infrastructure/redis/.env
required: false
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
networks:
- default
restart: unless-stopped
shm_size: 4mb
volumes:
- type: volume
source: redis_data
target: /data
read_only: false
minio-init:
image: docker.io/minio/minio:RELEASE.2025-09-07T16-13-09Z
entrypoint: >
/bin/sh -c "
sleep 5;
/usr/bin/mc alias set minio http://minio:9000 admin password;
/usr/bin/mc mb minio/datarush;
exit 0;
"
env_file:
- path: ./infrastructure/minio/.env.template
required: true
- path: ./infrastructure/minio/.env
required: false
restart: no
volumes:
- type: volume
source: minio_data
target: /data
minio:
image: docker.io/minio/minio:RELEASE.2025-09-07T16-13-09Z
command: server --console-address ":9001"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
env_file:
- path: ./infrastructure/minio/.env.template
required: true
- path: ./infrastructure/minio/.env
required: false
ports:
- name: api
target: 9000
published: 8005
host_ip: 127.0.0.1
protocol: tcp
app_protocol: http
- name: console
target: 9001
published: 8006
host_ip: 127.0.0.1
protocol: tcp
app_protocol: http
restart: unless-stopped
volumes:
- type: volume
source: minio_data
target: /data
networks:
default:
driver: bridge
name: $COMPOSE_PROJECT_NAME
attachable: false
enable_ipv4: true
enable_ipv6: true
internal: false
volumes:
postgres_data:
pgadmin_data:
redis_data:
minio_data:
configs:
nginx_config:
file: ./infrastructure/nginx/nginx.conf
postgres_config:
file: ./infrastructure/postgres/postgresql.conf
pgadmin_servers_config:
file: ./infrastructure/pgadmin/servers.json
redis_config:
file: ./infrastructure/redis/redis.conf