# This file is for local development. The production service description # is stored in portainer. # # Note that there is some duplication with defaults.env - this is because env_file # directives don't get interpolated into the docker-compose.yml. # see https://github.com/docker/compose/issues/3435 # # Specifically, DB_PORT, CERTS_CACHE, etc variables have defaults here that # must match defaults.env. services: db: container_name: ocw-db image: cockroachdb/cockroach:v22.2.6 environment: - COCKROACH_DATABASE=opencourseworld - COCKROACH_USER=root command: - start-single-node - --insecure - --sql-addr=:${DB_PORT:-5432} - --listen-addr=:26257 - --locality=region=wizulus ports: - ${DB_PORT:-5432}:${DB_PORT:-5432} volumes: - './data/db:/cockroach/cockroach-data:rw' - "./config/initdb:/docker-entrypoint-initdb.d:ro" app: ports: - ${HTTP_PORT:-6001}:${HTTP_PORT:-6001} - ${HTTPS_PORT:-6000}:${HTTPS_PORT:-6000} volumes: - './data/dumps:/app/data/dumps:rw' - './data/course_import_cache:/app/data/course_import_cache:rw' - './db/migrations:/app/db/migrations:rw' # overwrite the scripts from Dockerfile so all the dev scripts are present - './scripts:/app/scripts:ro' build: dockerfile: Dockerfile command: - bash - '-c' - 'source ./scripts/defaults.sh && exec /bin/server' environment: - DB_HOST=ocw-db - LISTEN_ADDRESS_HTTP=:${HTTP_PORT:-6001} - LISTEN_ADDRESS=:${HTTPS_PORT:-6000} # inherit from .env and the os env - APP_PORT - DB_PORT - HTTP_PORT - HTTPS_PORT - LISTEN_HOST - DB_USER - DB_NAME - ENABLE_API_DEV_USER - FORCE_HTTP - DEBUG_LEVEL - COURSE_IMPORT_REQUIRE_VERIFY - COURSE_IMPORT_ENABLE_CACHE - USE_DUMP_FOR_SEARCHES - MIXED_DIFFICULTY - DATA_VIEW_TYPE - DUMP_FILENAME - DUMP_THUMBS_FILENAME - JWT_SECRET - TWITCH_CLIENT_ID - TWITCH_CLIENT_SECRET - DISCORD_CLIENT_ID - DISCORD_CLIENT_SECRET - DISCORD_REPORT_TOKEN - ENABLE_TAGS - DB_SCHEMA_NAME - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY - APP_URLS - API_URLS - REDIRECT_URLS - DYNA_URL - DNS_WHITELIST