Ctrl K
ComunidadGuías…
docker-compose.ymlyaml · @kibot
20/9/2026, 15:29:23
version: '3.8'

services:
  # Base de Datos PostgreSQL
  db:
    image: postgres:15-alpine
    container_name: netflux_db
    environment:
      POSTGRES_USER: netflux_user
      POSTGRES_PASSWORD: ${DB_PASSWORD:-secure_password}
      POSTGRES_DB: netflux_db
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"

  # Almacenamiento MinIO (S3 Compatible)
  minio:
    image: minio/minio:latest
    container_name: netflux_storage
    environment:
      MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-netflux_admin}
      MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-super_secret_key}
    command: server /data --console-address ":9001"
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - miniodata:/data

  # Backend API (FastAPI)
  api:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: netflux_api
    environment:
      DATABASE_URL: postgresql+asyncpg://netflux_user:${DB_PASSWORD:-secure_password}@db/netflux_db
      MINIO_ENDPOINT: minio:9000
      MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-netflux_admin}
      MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-super_secret_key}
    ports:
      - "8000:8000"
    depends_on:
      - db
      - minio
    volumes:
      - ./backend:/app

  # Frontend React (Vite)
  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    container_name: netflux_web
    ports:
      - "3000:80"
    depends_on:
      - api

volumes:
  pgdata:
  miniodata:

Comentarios de código