diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3bb5569 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +BG_BEARER_TOKEN=your_token_here +BG_EVENT_ID=1 +BG_RANKING=stableford_gross +POLL_INTERVAL_MS=10000 +STALE_THRESHOLD_MS=60000 +PORT=3737 diff --git a/.gitignore b/.gitignore index 552f221..53a89d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ *.log +.env diff --git a/docker-compose.yml b/docker-compose.yml index 1078294..770a3db 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,17 +7,12 @@ services: - ./:/app command: sh -c "npm install --silent && node server.js" ports: - - "3737:3737" - environment: - BG_BEARER_TOKEN: "bg_live_k_K1zO7Jh-fMkRttp8.uoD4OzE3L_SrLXu0tTsS_4nDdL8DkhzRV6eOSXSkivY" - BG_EVENT_ID: "1" - BG_RANKING: "stableford_gross" - POLL_INTERVAL_MS: "10000" - STALE_THRESHOLD_MS: "60000" - PORT: "3737" + - "${PORT:-3737}:${PORT:-3737}" + env_file: + - .env restart: unless-stopped healthcheck: - test: ["CMD", "wget", "-qO-", "http://localhost:3737/ping"] + test: ["CMD", "wget", "-qO-", "http://localhost:${PORT:-3737}/ping"] interval: 15s timeout: 5s retries: 3