## ## Production server config (wip) ## You probably want to run: ## export COMPOSE_FILE="docker-compose.yml:docker-compose.production.yml" ## docker-compose up -d ## version: "3.1" services: web: profiles: ["ol-web1", "ol-web2"] image: "${OLIMAGE:-openlibrary/olbase:latest}" restart: always hostname: "$HOSTNAME" environment: - GUNICORN_OPTS= --workers 50 --timeout 300 --max-requests 500 - OL_CONFIG=/olsystem/etc/openlibrary.yml - BEFORE_START=pip install -e /booklending_utils volumes: - ../booklending_utils:/booklending_utils - ../olsystem:/olsystem - ../olsystem/etc/ia.ini:/home/openlibrary/.config/ia.ini solr: # TODO: Currently solr is deployed in a "special" way profiles: [] covers: profiles: ["ol-covers0"] image: "${OLIMAGE:-openlibrary/olbase:latest}" restart: always hostname: "$HOSTNAME" environment: - GUNICORN_OPTS= --workers 30 --max-requests 500 - COVERSTORE_CONFIG=/olsystem/etc/coverstore.yml volumes: - ../olsystem:/olsystem - /1:/1 covers_nginx: profiles: ["ol-covers0"] image: nginx:1.19.4 restart: always depends_on: - covers volumes: - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro - ./docker/covers_nginx.conf:/etc/nginx/sites-enabled/covers_nginx.conf:ro # Needed for HTTPS, since this is a public server - ../olsystem/etc/nginx/sites-available/default-docker.conf:/etc/nginx/sites-enabled/default:ro # Needs access to openlibrary for static files - ../olsystem:/olsystem - /1/var/lib/openlibrary/sitemaps/sitemaps:/sitemaps ports: - 80:80 - 443:443 networks: - webnet logging: options: max-size: "512m" max-file: "4" secrets: - petabox_seed # Needed by default-docker.conf - ssl_certificate - ssl_certificate_key memcached: profiles: ["ol-covers0"] cron-jobs: profiles: ["ol-home0"] image: "${OLIMAGE:-openlibrary/olbase:latest}" hostname: "$HOSTNAME" user: root command: docker/ol-cron-start.sh restart: always volumes: - ../olsystem/etc/cron.d/openlibrary.ol_home0:/etc/cron.d/openlibrary.ol_home0:ro - ../olsystem:/olsystem - /1/var/tmp:/1/var/tmp networks: - webnet - dbnet secrets: - ia_db_pw_file infobase: profiles: ["ol-home0"] image: "${OLIMAGE:-openlibrary/olbase:latest}" restart: always hostname: "$HOSTNAME" environment: - INFOBASE_OPTS= fastcgi - INFOBASE_CONFIG=/olsystem/etc/infobase.yml volumes: - ../olsystem:/olsystem - infobase-writelog:/1/var/lib/openlibrary/infobase/log - infobase-errorlog:/1/var/log/openlibrary/infobase-errors infobase_nginx: profiles: ["ol-home0"] image: nginx:1.19.4 restart: always depends_on: - infobase volumes: - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro - ./docker/infobase_nginx.conf:/etc/nginx/sites-enabled/infobase_nginx.conf:ro # Needs olsystem for black-listed IPs - ../olsystem:/olsystem ports: - 7000:7000 networks: - webnet secrets: - petabox_seed affiliate-server: profiles: ["ol-home0"] image: "${OLIMAGE:-openlibrary/olbase:latest}" restart: always hostname: "$HOSTNAME" environment: - AFFILIATE_CONFIG=/openlibrary.yml command: docker/ol-affiliate-server-start.sh ports: - 31337:31337 volumes: - /opt/olsystem/etc/openlibrary.yml:/openlibrary.yml networks: - webnet logging: options: max-size: "512m" max-file: "4" solr-updater: profiles: ["ol-home0"] image: "${OLIMAGE:-openlibrary/olbase:latest}" restart: always hostname: "$HOSTNAME" environment: - OL_CONFIG=/olsystem/etc/openlibrary.yml - OL_URL=https://openlibrary.org/ volumes: - ../olsystem:/olsystem logging: options: max-size: "512m" max-file: "4" secrets: - ia_db_pw_file # This will replace solr-updater once we fully migrate to solr8 solr8-updater: profiles: ["ol-home0"] image: "${OLIMAGE:-openlibrary/olbase:latest}" restart: always hostname: "$HOSTNAME" environment: - PYENV_VERSION=${PYENV_VERSION:-} - OL_CONFIG=/olsystem/etc/openlibrary.yml - OL_URL=https://openlibrary.org/ - STATE_FILE=solr8-update.offset - EXTRA_OPTS=--solr-url http://ol-solr1:8984/solr/openlibrary --initial-state '2021-04-12:0' volumes: - solr-updater-data:/solr-updater-data - ../olsystem:/olsystem secrets: - ia_db_pw_file command: docker/ol-solr-updater-start.sh networks: - webnet - dbnet importbot: profiles: ["ol-home0"] image: "${OLIMAGE:-openlibrary/olbase:latest}" command: docker/ol-importbot-start.sh restart: always hostname: "$HOSTNAME" environment: - OL_CONFIG=/olsystem/etc/openlibrary.yml - OPENLIBRARY_RCFILE=/olsystem/etc/olrc-importbot - PYENV_VERSION=${PYENV_VERSION:-} volumes: - ../olsystem:/olsystem networks: - webnet - dbnet secrets: petabox_seed: file: /opt/.petabox/seed ia_db_pw_file: file: /opt/.petabox/dbserver # SSL-related secrets ssl_certificate: file: /opt/.petabox/openlibrary.org.combined.crt ssl_certificate_key: file: /opt/.petabox/openlibrary.org.nopassword.key volumes: infobase-writelog: infobase-errorlog: