version: '3.2' # p.g.o consists nominally of: # A service to sync the tree to $TREE_DIR && update the index. # The index updater simply submits work items into sidekiq. # ElasticSearch to managed updates and serve documents. # SideKiq requires redis. # # To this end we define 4 containers. # - HTTP Serving: Serves the site, and the /sidekiq endpoing. # - Elasticsearch: runs the elasticsearch service. # - Redis: Run Redis for Sidekiq. # - Refresher: Syncs the package tree and pushes updates into sidekiq. # # For further information about usage during development / production # please refer to docker-compose.override.yml # services: http-serving: image: ${GPACKAGES_IMAGE:-gentoo/packages:latest} ports: - 127.0.0.1:5000:5000 volumes: - type: volume source: portage target: /var/db/repos/gentoo - type: volume source: portage-git target: /mnt/packages-tree environment: # "Redis:port" and "elasticsearch:port" refer to sibling containers. - REDIS_PROVIDER=REDIS_URL - REDIS_URL=redis://redis:6379 - ELASTICSEARCH_URL=elasticsearch:9200 - RAILS_SERVE_STATIC_FILES=1 - RAILS_ENV=production - NODE_ENV=production - MEMCACHE_URL="memcache:11211" - SECRET_KEY_BASE= ${SECRET_KEY_BASE:-6c9710aeb74dd88ff1d1b8f4bd6d7d8e0f340905d0974400fffd7246714aa703cf7bf4a98c0bc90317a3b803b82c0f9371e18ada19fc4eed9d6118077a249f50} restart: always labels: com.centurylinklabs.watchtower.enable: "true" depends_on: - redis - elasticsearch command: bash -c "cp config/initializers/kkuleomi_config.rb.dist config/initializers/kkuleomi_config.rb && /var/www/packages.gentoo.org/htdocs/bin/first-run production" sidekiq: image: ${GPACKAGES_IMAGE:-gentoo/packages:latest} volumes: - type: volume source: portage target: /var/db/repos/gentoo - type: volume source: portage-git target: /mnt/packages-tree environment: - RAILS_ENV=production - NODE_ENV=production - RAILS_SERVE_STATIC_FILES=1 - REDIS_URL=redis://redis:6379 - MEMCACHE_URL="memcache:11211" - ELASTICSEARCH_URL=elasticsearch:9200 - SECRET_KEY_BASE= ${SECRET_KEY_BASE:-6c9710aeb74dd88ff1d1b8f4bd6d7d8e0f340905d0974400fffd7246714aa703cf7bf4a98c0bc90317a3b803b82c0f9371e18ada19fc4eed9d6118077a249f50} restart: always labels: com.centurylinklabs.watchtower.enable: "true" depends_on: - redis - elasticsearch command: > bash -c " cp config/initializers/kkuleomi_config.rb.dist config/initializers/kkuleomi_config.rb && bundler install && yarn install --check-files && bundle exec sidekiq -c 5" memcache: image: memcached:${MEMCACHED_VERSION:-1.5} restart: always elasticsearch: # TODO(antarus): We should build a docker image for this based on gentoo. image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.3.1} volumes: - ${ELASTICSEARCH_DATA_PATH:-/var/lib/elasticsearch/data/}:/usr/share/elasticsearch/data/ environment: - node.name=packages - cluster.initial_master_nodes=packages - cluster.routing.allocation.node_initial_primaries_recoveries=8 - cluster.routing.allocation.node_concurrent_outgoing_recoveries=8 - cluster.routing.allocation.node_concurrent_incoming_recoveries=8 - indices.recovery.max_bytes_per_sec=200mb - "ES_JAVA_OPTS=-Xms4g -Xmx4g" ulimits: memlock: soft: -1 hard: -1 restart: always redis: image: redis:${REDIS_VERSION:-4.0.6} restart: always watchtower: image: containrrr/watchtower:0.3.10 volumes: - /var/run/docker.sock:/var/run/docker.sock - /root/.docker/config.json:/config.json command: --label-enable volumes: portage: portage-git: