Ctrl K
ComunidadGuías…

docker-compose.dev.yml

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
# ─────────────────────────────────────────────────────────────
# Local development: brings up the backing services the app needs — Postgres and
# RustFS — with host-published ports, so one command starts them together instead
# of running each by hand. The api, web, worker, and Telegram bot apps run on the
# host via `bun run dev` (watch/hot-reload, turbo) and reach these over localhost.
#
#   docker compose -f docker-compose.dev.yml up -d      # starts postgres + rustfs (+ bucket init)
#
# If host port 5432 is taken (a local Postgres is already running),
# pick another:  POSTGRES_PORT=5433 docker compose -f docker-compose.dev.yml up -d
# and update the port in DATABASE_URL inside .env.
#
# The self-hosting stack (every service, built from source) lives in
# docker-compose.yml; the Coolify variant in docker-compose.coolify.yml.
# ─────────────────────────────────────────────────────────────
name: itsaplan-dev

services:
  postgres:
    image: postgres:17-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-itsaplan}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-itsaplan}
      POSTGRES_DB: ${POSTGRES_DB:-itsaplan}
    ports:
      - '${POSTGRES_PORT:-5432}:5432'
    volumes:
      - postgres-dev-data:/var/lib/postgresql/data
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-itsaplan} -d ${POSTGRES_DB:-itsaplan}']
      interval: 5s
      timeout: 5s
      retries: 10

  # S3-compatible object store for issue attachments (RustFS).
  # The attachments bucket is created by the minio-init service below.
  #   S3 API:      http://localhost:9000
  #   Web console: http://localhost:9001/rustfs/console/
  #     login with S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY from .env
  #
  # The service and volume keep their MinIO-era names so an existing dev stack
  # upgrades in place: RustFS reads the files MinIO wrote, and runs as root because
  # MinIO wrote them as root.
  minio:
    image: rustfs/rustfs:1.0.0
    restart: unless-stopped
    user: '0:0'
    environment:
      RUSTFS_ACCESS_KEY: ${S3_ACCESS_KEY_ID:-minioadmin}
      RUSTFS_SECRET_KEY: ${S3_SECRET_ACCESS_KEY:-minioadmin}
    ports:
      - '9000:9000'
      - '9001:9001'
    volumes:
      - minio-dev-data:/data
    healthcheck:
      test: ['CMD', 'curl', '-fsS', '-o', '/dev/null', 'http://127.0.0.1:9000/health']
      interval: 5s
      timeout: 5s
      retries: 10

  # One-shot: creates the attachments bucket, then exits. A PUT on a bucket that
  # already exists succeeds, so it runs on every start.
  minio-init:
    image: rustfs/rustfs:1.0.0
    depends_on:
      minio:
        condition: service_healthy
    environment:
      S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-minioadmin}
      S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-minioadmin}
      S3_BUCKET: ${S3_BUCKET:-planner-attachments}
    entrypoint: >
      /bin/sh -c "
      curl -fsS -X PUT --aws-sigv4 aws:amz:us-east-1:s3 --user \"$$S3_ACCESS_KEY_ID:$$S3_SECRET_ACCESS_KEY\" http://minio:9000/\"$$S3_BUCKET\" &&
      echo 'bucket ready: '\"$$S3_BUCKET\"
      "

volumes:
  postgres-dev-data:
  minio-dev-data: