version: '3.3'

services:
  app: &app
    build:
      context: .
      args:
        NODE_MAJOR: "18"
        RUBY_VERSION: ${RUBY_VERSION}
    image: bootstrap-form:latest-$RUBY_VERSION
    tmpfs:
      - /tmp

  shell: &shell
    <<: *app
    stdin_open: true
    tty: true
    volumes:
      - .:/app:cached
    environment:
      - SSH_AUTH_SOCK=/ssh-agent
      - NODE_ENV=development
      - RAILS_ENV=${RAILS_ENV:-development}
      - BOOTSNAP_CACHE_DIR=/usr/local/bundle/_bootsnap
      - WEB_CONCURRENCY=1
      - HISTFILE=/app/.bash_history
    ports:
      - "3000:3000"
    command: /bin/bash
