# To run the Archive in docker for the first time you should run one of the init scripts: # - linux: `script/docker/init.sh` # - windows: `script/docker/init.cmd` # # This will handle setting up config files, creating databases, and running migrations. # # After these oneoff tasks have been performed, you can start the development # webserver with the command: # # ``` # docker compose up -d web # ``` # # Once it is running, it will be visible at http://localhost:3000/ # # To run tests, you should use the test container instead of the web container, # because it includes a headless chrome container for running JS-based tests. # You can run tests like this: # # ``` # docker compose run --rm test bundle exec cucumber features/other_a/autocomplete.feature # ``` volumes: my-datavolume: redis-data: esdata1: services: db: image: mariadb:10.5.4-focal environment: - MYSQL_ROOT_PASSWORD=change_me ports: - "3306:3306" command: [ "mysqld", "--sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION", ] volumes: - my-datavolume:/var/lib/mysql:rw redis: image: redis:7 ports: - "6379:6379" volumes: - redis-data:/var/lib/redis:rw es: image: docker.elastic.co/elasticsearch/elasticsearch:9.3.0 ports: - "9200:9200" - "9300:9300" - "9400:9400" volumes: - esdata1:/usr/share/elasticsearch/data:rw environment: - transport.host=localhost - bootstrap.memory_lock=false - "ES_JAVA_OPTS=-Xms1500m -Xmx1500m" - discovery.type=single-node # Silence "security features are not enabled" warnings # https://github.com/elastic/elasticsearch/issues/78500 - xpack.security.enabled=false mc: image: memcached:1.5 ports: - "11211:11211" web: profiles: - dev build: context: . dockerfile: ./config/docker/Dockerfile environment: &environment RAILS_ENV: development # Disable rack-timeout RACK_TIMEOUT_SERVICE_TIMEOUT: 0 CODESPACES: ${CODESPACES:-} CODESPACE_NAME: ${CODESPACE_NAME:-} GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN: ${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-} command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" volumes: - .:/otwa ports: - "3000:3000" depends_on: - db - redis - es - mc - resque # Make `docker compose attach web` work for debugging stdin_open: true tty: true resque: profiles: - dev build: context: . dockerfile: ./config/docker/Dockerfile command: bash -c "bundle exec rake environment resque:scheduler & bundle exec rake environment resque:work" volumes: - .:/otwa environment: <<: *environment QUEUE: '*' depends_on: - db - redis chrome: profiles: - test image: selenium/standalone-chromium ports: - "4444:4444" test: profiles: - test build: context: . dockerfile: ./config/docker/Dockerfile environment: - RAILS_ENV=test - CHROME_URL=http://chrome:4444 - DOCKER=true - CAPYBARA_PORT=5100 - CUCUMBER_PUBLISH_QUIET=true # Silence ebook-convert warning about running as root - QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox command: sleep infinity volumes: - .:/otwa ports: - "5100:5100" depends_on: - db - redis - es - mc - chrome