##
## Staging server config (wip)
## You probably want to run:
## export COMPOSE_FILE="compose.yaml:compose.staging.yaml"
## docker compose up -d
##

services:
  web:
    build:
      context: .
      dockerfile: docker/Dockerfile.oldev
    restart: unless-stopped
    hostname: "$HOSTNAME"
    environment:
      - GUNICORN_OPTS= --workers 4 --timeout 180
      - OL_CONFIG=/olsystem/etc/openlibrary.yml
      - BEFORE_START=pip install -e /booklending_utils
    volumes:
      - ../olsystem:/olsystem
      - ../booklending_utils:/booklending_utils
      - ../olsystem/etc/ia.ini:/home/openlibrary/.config/ia.ini
      # Persistent volume mount for installed git submodules
      - ol-vendor:/openlibrary/vendor
      # Persistent volume mount for generated css and js
      - ol-build:/openlibrary/static/build
      # Persistent volume mount for node_modules
      - ol-nodemodules:/openlibrary/node_modules
      # The above volume mounts are required so that the local dev bind mount below
      # does not clobber the data generated inside the image / container
      - .:/openlibrary

  memcached:
    restart: unless-stopped

volumes:
  ol-vendor:
  ol-build:
  ol-nodemodules:
