cortex-cms/cortex-starter

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
---
version: "3"
services:
  web:
    build:
      context: .
      args:
      - RAILS_ENV=development
      - PRECOMPILE_ASSETS=false
    volumes:
    - .:/app
    entrypoint: dockerize -wait tcp://postgres:5432 -wait tcp://redis:6379 -wait tcp://elasticsearch:9200 -timeout 2m /app/docker-entrypoint.sh
    command: "bin/rails server"
    ports:
    - "3000:3000"
    links:
    - postgres
    - redis
    - elasticsearch
    - webpacker
    env_file:
    - .env.docker-compose
    - .env
    depends_on:
    - postgres
    - redis
    - elasticsearch

  sidekiq:
    build:
      context: .
      args:
      - RAILS_ENV=development
      - PRECOMPILE_ASSETS=false
    volumes:
    - .:/app
    command: dockerize -wait tcp://postgres:5432 -wait tcp://redis:6379 -wait tcp://elasticsearch:9200 -timeout 2m bundle exec sidekiq --config ./config/sidekiq.yml
    links:
    - postgres
    - redis
    - elasticsearch
    env_file:
    - .env.docker-compose
    - .env
    depends_on:
    - postgres
    - redis
    - elasticsearch

  webpacker:
    build:
      context: .
      args:
      - RAILS_ENV=development
      - PRECOMPILE_ASSETS=false
    volumes:
    - .:/app
    command: dockerize -wait tcp://postgres:5432 -wait tcp://redis:6379 -wait tcp://elasticsearch:9200 -timeout 2m sh -c "rm -rf public/packs/* || true && bin/rails react_on_rails:locale && bin/webpack-dev-server"
    ports:
    - "3035:3035"
    links:
    - postgres
    - redis
    - elasticsearch
    env_file:
    - .env.docker-compose
    - .env
    depends_on:
    - postgres
    - redis
    - elasticsearch

  postgres:
    image: postgres:10.4-alpine
    ports:
    - "5433:5432"
    volumes:
    - "postgres:/var/lib/postgresql/data"

  redis:
    image: redis:4.0-alpine
    volumes:
    - "redis:/data"

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.6.10
    ports:
    - "9201:9200"
    - "9301:9300"
    volumes:
    - "elasticsearch:/usr/share/elasticsearch/data"
    environment:
    - xpack.security.enabled=false

volumes:
  postgres:
  redis:
  elasticsearch: