hopsoft/turbo_ready

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
version: "3.9"

networks:
  primary:

volumes:
  external:
  node_modules:

x-default-env: &default_env
  GEM_HOME: /mnt/external/bundle
  PLAYWRIGHT_BROWSERS_PATH: 0
  RAILS_ENV: development
  RAILS_LOG_TO_STDOUT: true
  RAILS_SERVE_STATIC_FILES: true

x-default-app: &default_app
  build: .
  image: hopsoft/turbo_boost-streams
  tty: true
  stdin_open: true
  environment:
    <<: *default_env
  networks:
    - primary
  volumes:
    - .:/app
    - external:/mnt/external
    - node_modules:/app/node_modules

services:
  ## ==========================================================================================================
  ## Shell
  ## ==========================================================================================================
  #shell:
  #  <<: *default_app
  #  container_name: turbo_boost-streams-shell
  #  command: tail -f /dev/null

  # ==========================================================================================================
  # Web - Runs the test/dummy Rails app
  # ==========================================================================================================
  web:
    <<: *default_app
    container_name: turbo_boost-streams-web
    ports:
      - 3000:3000
    command: bin/docker/run/local
    healthcheck:
      test: ["CMD", "curl", "--silent", "--fail", "http://localhost:3000/health"]
      interval: 30s
      timeout: 30s
      retries: 10

  # ==========================================================================================================
  # ESBuild - Runs the esbuild watcher
  # ==========================================================================================================
  esbuild:
    <<: *default_app
    container_name: turbo_boost-streams-esbuild
    command: /bin/bash -c "npm run build -- --watch"
    depends_on:
      web:
        condition: service_healthy

  # ==========================================================================================================
  # Tailwind - Runs the Tailwind watcher
  # ==========================================================================================================
  tailwind:
    <<: *default_app
    container_name: turbo_boost-streams-tailwind
    working_dir: /app/test/dummy
    command: bin/rails tailwindcss:watch
    depends_on:
      web:
        condition: service_healthy