147 lines
3.8 KiB
YAML
147 lines
3.8 KiB
YAML
version: "3.9"
|
|
|
|
x-minio-env: &minio_env
|
|
MINIO_ROOT_USER: minioautumn
|
|
MINIO_ROOT_PASSWORD: minioautumn
|
|
|
|
services:
|
|
# --- Datastores / Infra ---
|
|
redis:
|
|
image: eqalpha/keydb:latest
|
|
container_name: stoat-redis
|
|
restart: unless-stopped
|
|
ports: ["6379:6379"]
|
|
|
|
database:
|
|
image: mongo:7
|
|
container_name: stoat-mongo
|
|
restart: unless-stopped
|
|
volumes:
|
|
- mongo_data:/data/db
|
|
ports: ["27017:27017"]
|
|
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: stoat-minio
|
|
restart: unless-stopped
|
|
environment: *minio_env
|
|
command: server /data --console-address ":9001"
|
|
volumes:
|
|
- minio_data:/data
|
|
ports:
|
|
- "9000:9000" # S3 API
|
|
- "9001:9001" # Console UI
|
|
|
|
create-minio-bucket:
|
|
image: minio/mc:latest
|
|
container_name: stoat-minio-mc
|
|
depends_on: [minio]
|
|
restart: "no"
|
|
environment: *minio_env
|
|
entrypoint: >
|
|
/bin/sh -c "
|
|
/usr/bin/mc alias set local http://minio:9000 $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD} &&
|
|
/usr/bin/mc mb -p local/revolt-uploads || true &&
|
|
/usr/bin/mc anonymous set download local/revolt-uploads || true &&
|
|
sleep 2
|
|
"
|
|
|
|
rabbitmq:
|
|
image: rabbitmq:3-management
|
|
container_name: stoat-rabbitmq
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5672:5672"
|
|
- "15672:15672"
|
|
|
|
maildev:
|
|
image: soulteary/maildev:latest
|
|
container_name: stoat-maildev
|
|
restart: unless-stopped
|
|
environment:
|
|
MAILDEV_SMTP_PORT: "25"
|
|
MAILDEV_WEB_PORT: "8080"
|
|
MAILDEV_INCOMING_USER: "smtp"
|
|
MAILDEV_INCOMING_PASS: "smtp"
|
|
ports:
|
|
- "14025:25"
|
|
- "14080:8080"
|
|
|
|
# --- Build the Rust backend into a single image we can reuse for each service ---
|
|
backend-build:
|
|
build:
|
|
context: ../stoatchat-main
|
|
dockerfile: Dockerfile # change to Dockerfile.useCurrentArch if your repo has that
|
|
image: stoatchat-backend:local
|
|
container_name: stoat-backend-build
|
|
command: ["bash","-lc","echo built"]
|
|
restart: "no"
|
|
|
|
# --- Backend services (all use the same built image) ---
|
|
autumn:
|
|
image: stoatchat-backend:local
|
|
container_name: stoat-autumn
|
|
depends_on: [database, redis, minio, create-minio-bucket]
|
|
restart: unless-stopped
|
|
working_dir: /home/rust/src
|
|
command: ["/home/rust/src/target/release/revolt-autumn"]
|
|
environment:
|
|
RUST_LOG: "info"
|
|
ports: ["14704:14704"]
|
|
volumes:
|
|
- ./Revolt.overrides.toml:/Revolt.toml:ro
|
|
|
|
january:
|
|
image: stoatchat-backend:local
|
|
container_name: stoat-january
|
|
depends_on: [database, redis, rabbitmq, maildev]
|
|
restart: unless-stopped
|
|
working_dir: /home/rust/src
|
|
command: ["/home/rust/src/target/release/revolt-january"]
|
|
environment:
|
|
RUST_LOG: "info"
|
|
ports: ["14705:14705"]
|
|
volumes:
|
|
- ./Revolt.overrides.toml:/Revolt.toml:ro
|
|
|
|
gifbox:
|
|
image: stoatchat-backend:local
|
|
container_name: stoat-gifbox
|
|
depends_on: [database, redis]
|
|
restart: unless-stopped
|
|
working_dir: /home/rust/src
|
|
command: ["/home/rust/src/target/release/revolt-gifbox"]
|
|
environment:
|
|
RUST_LOG: "info"
|
|
ports: ["14706:14706"]
|
|
volumes:
|
|
- ./Revolt.overrides.toml:/Revolt.toml:ro
|
|
|
|
pushd:
|
|
image: stoatchat-backend:local
|
|
container_name: stoat-pushd
|
|
depends_on: [rabbitmq, database, redis]
|
|
restart: unless-stopped
|
|
working_dir: /home/rust/src
|
|
command: ["/home/rust/src/target/release/revolt-pushd"]
|
|
environment:
|
|
RUST_LOG: "info"
|
|
volumes:
|
|
- ./Revolt.overrides.toml:/Revolt.toml:ro
|
|
|
|
crond:
|
|
image: stoatchat-backend:local
|
|
container_name: stoat-crond
|
|
depends_on: [database, redis]
|
|
restart: unless-stopped
|
|
working_dir: /home/rust/src
|
|
command: ["/home/rust/src/target/release/revolt-crond"]
|
|
environment:
|
|
RUST_LOG: "info"
|
|
volumes:
|
|
- ./Revolt.overrides.toml:/Revolt.toml:ro
|
|
|
|
volumes:
|
|
mongo_data:
|
|
minio_data:
|