Ctrl K
ComunidadGuías…

docker-compose.yml

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

Archivo original ↗Preguntar a KiBot
services:
  web: &web
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - "3000:3000"
      - "33149:33149"
    volumes:
      - .:/app
      - bundle_cache:/usr/local/bundle
      - node_modules:/app/node_modules
    environment:
      - RAILS_ENV=development
      - DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_development
      - POSTGRES_HOST=db
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=secureorpheus123
      - TEST_DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_test
    depends_on:
      db:
        condition: service_healthy
    command: ["sleep", "infinity"]

  portal:
    <<: *web
    profiles:
      - portal
    ports:
      - "3001:3000"
    environment:
      - RAILS_ENV=development
      - DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_development
      - TEST_DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_test
      - PUBLIC_URL=${PUBLIC_URL:-}
    entrypoint: []
    command: ["bin/rails", "server", "-b", "0.0.0.0", "-p", "3000", "-P", "/tmp/portal-server.pid"]

  db:
    image: postgres:16
    volumes:
      - harbor_postgres_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=secureorpheus123
      - POSTGRES_USER=postgres
      - POSTGRES_DB=app_development
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d app_development"]
      interval: 2s
      timeout: 5s
      retries: 15
    ports:
      - "5432:5432"

volumes:
  harbor_postgres_data:
  bundle_cache:
  node_modules: