Ctrl K
ComunidadGuías…

docker-compose.yml

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

Archivo original ↗Preguntar a KiBot
version: '2.4'

x-app: &app
  build:
    context: .
    dockerfile: ./Dockerfile.development
    args:
      RUBY_VERSION: '3.3.5'
      PG_MAJOR: '15'
      NODE_MAJOR: '16'
      YARN_VERSION: '1.13.0'
      BUNDLER_VERSION: '2.3.26'
  environment: &env
    NODE_ENV: development
    RAILS_ENV: ${RAILS_ENV:-development}
    ANYCABLE_DEBUG: ${DEBUG:-0}
    ANYCABLE_RPC_HOST: 0.0.0.0:50051
  image: chaskiq/chaskiq:1.1.0
  tmpfs:
    - /tmp

x-backend: &backend
  <<: *app
  stdin_open: true
  tty: true
  volumes:
    - .:/app:cached
    - rails_cache:/app/tmp/cache
    - bundle:/usr/local/bundle
    - node_modules:/app/node_modules
    - packs:/app/public/packs
    - .dockerdev/.psqlrc:/root/.psqlrc:ro
    - .dockerdev/.bashrc:/root/.bashrc:ro
  environment:
    <<: *env
    REDIS_URL: redis://redis:6379/
    DATABASE_URL: postgres://postgres:password@postgres:5432
    BOOTSNAP_CACHE_DIR: /usr/local/bundle/_bootsnap
    WEBPACKER_DEV_SERVER_HOST: webpacker
    DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: 1
    WEB_CONCURRENCY: 1
    HISTFILE: /app/log/.bash_history
    PSQL_HISTFILE: /app/log/.psql_history
    EDITOR: vi
  depends_on:
    postgres:
      condition: service_healthy
    redis:
      condition: service_healthy

services:
  runner:
    <<: *backend
    command: /bin/bash

  rpc:
    <<: *backend
    command: bundle exec anycable

  anycable:
    image: 'anycable/anycable-go:1.0-alpine'
    ports:
      - "8080:8080"
    environment:
      PORT: 8080
      ANYCABLE_HOST: 0.0.0.0
      ANYCABLE_HEADERS: cookie,origin
      REDIS_URL: redis://redis:6379/0
      ANYCABLE_RPC_HOST: rpc:50051
      ANYCABLE_DEBUG: ${DEBUG:-0}
    depends_on:
      - redis
      - rpc

  rails:
    <<: *backend
    command: ./bin/dev
    ports:
      - '3000:3000'
      - '3001:3001'

  sidekiq:
    <<: *backend
    command: bundle exec sidekiq -C config/sidekiq.yml

  postgres:
    image: postgres:14-alpine
    volumes:
      - ~/apps/postgres:/var/lib/postgresql/data
    environment:
      #POSTGRES_USER: postgresql
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
      PSQL_HISTFILE: /root/log/.psql_history
    ports:
      - 5432
    healthcheck:
      test: pg_isready -U postgres -h 127.0.0.1
      interval: 5s

  redis:
    image: redis:5-alpine
    volumes:
      - redis:/data
    ports:
      - 6379
    healthcheck:
      test: redis-cli ping
      interval: 1s
      timeout: 3s
      retries: 30

volumes:
  postgres: null
  redis: null
  bundle: null
  node_modules: null
  rails_cache: null
  packs: null