version: '3.5' services: rails_base: &rails_base build: context: . dockerfile: ./config/docker/rails_base/Dockerfile tmpfs: - /tmp volumes: - .:/app:cached - bundle:/bundle - node_modules:/app/node_modules - packs:/app/public/packs - rails_cache:/app/tmp/cache - ~/.ssh:/root/.ssh - irb_history:/root/irb_history - ./config/docker/web/.irbrc:/root/.irbrc stdin_open: true tty: true web: <<: *rails_base ports: - 3000:3000 command: rails s -b 0.0.0.0 environment: - WEBPACKER_DEV_SERVER_HOST=webpacker webpacker: <<: *rails_base ports: - 3035:3035 command: ./bin/webpack-dev-server environment: - WEBPACKER_DEV_SERVER_HOST=0.0.0.0 shell: <<: *rails_base command: bash <% if @mysql %> mysql: image: mysql:<%= @mysql_version %> volumes: - ./config/docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf - db_data:/var/lib/mysql - .:/app:cached environment: - MYSQL_ROOT_PASSWORD=root labels: - maintainer='paul@error.agency' ports: - 3306:3306 <% end %> <% if @redis %> redis: image: redis:3.2 labels: - maintainer='paul@error.agency' ports: - 6379:6379 <% end %> <% if @mailhog %> mailhog: command: ["-smtp-bind-addr", "0.0.0.0:2525"] user: root image: mailhog/mailhog ports: - 2525:2525 - 8025:8025 <% end %> <% if @elasticsearch %> elasticsearch: build: context: . dockerfile: ./config/docker/elasticsearch/Dockerfile ports: - "9200:9200" - "8080:8080" environment: # LOGSPOUT: 'ignore' # ES_JAVA_OPTS: '-Xms1024m -Xmx1024m' # bootstrap.memory_lock: 'false' discovery.type: 'single-node' # ulimits: # memlock: # soft: -1 # hard: -1 # nofile: # soft: 262144 # hard: 262144 volumes: - es_data:/usr/share/elasticsearch/data healthcheck: test: ["CMD", "curl", "-SsfL", "127.0.0.1:9200/_cat/health?h=status"] interval: 10s timeout: 1s retries: 10 <% end %> <% if @headless_chrome %> chrome: logging: driver: none ports: - 5900:5900 build: context: . shm_size: 2g dockerfile: ./config/docker/chrome/Dockerfile <% end %> volumes: bundle: node_modules: rails_cache: packs: db_data: irb_history: <% if @elasticsearch %>es_data:<% end %>