diff --git a/README.md b/README.md index 19d3eaf..8479e8d 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ unleash locally without setting up a database or node. $ docker-compose build $ docker-compose up ``` +On some computers the database won't start in time for Unleash the first time you run this. If Unleash fails to reach the database, `docker-compose restart web` usually resolves the issue. ### Requirements We are using docker-compose version 3.9 and it requires: diff --git a/docker-compose.yml b/docker-compose.yml index 4fb28e0..6387f70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,6 +37,12 @@ services: UNLEASH_API_TOKEN: "default:development.unleash-insecure-api-token" depends_on: - web + healthcheck: + test: wget --no-verbose --tries=1 --spider http://localhost:3000/proxy/health || exit 1 + interval: 1s + timeout: 1m + retries: 5 + # The Unleash server contains the Unleash configuration and # communicates with server-side SDKs and the Unleash Proxy @@ -61,11 +67,13 @@ services: # key from `proxy.environment.UNLEASH_PROXY_CLIENT_KEYS` # instead. INIT_CLIENT_API_TOKENS: "default:development.unleash-insecure-api-token" + # Changing log levels: + # LOG_LEVEL: "debug" depends_on: - db command: node index.js healthcheck: - test: ["CMD", "nc", "-z", "db", "5432"] + test: wget --no-verbose --tries=1 --spider http://localhost:4242/health || exit 1 interval: 1s timeout: 1m retries: 5