diff --git a/README.md b/README.md index d2780cb17a..d985fc1a3e 100644 --- a/README.md +++ b/README.md @@ -138,3 +138,14 @@ Check our [contributing documentation](./CONTRIBUTING.md) to know about our codi ## License Kuzzle is published under [Apache 2 License](./LICENSE.md). + +## About Mac M1 + +First of all make sure that you have at least `4GB` of ram allocated to your vm **docker desktop** and that it is running. + +Run the following command to install all the dependencies in your container: +```bash +npm run docker:install +``` + +finally run the command `docker-compose up` to launch your kuzzle stack. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 579e7b07c9..dc6e8506c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,9 @@ x-kuzzle-config: &kuzzle-config image: kuzzleio/core-dev:2 command: sh -c 'chmod 755 /run-dev.sh && /run-dev.sh' volumes: - - ".:/var/app" - - "./docker/scripts/run-dev.sh:/run-dev.sh" - - "./docker/fixtures:/fixtures" + - '.:/var/app' + - './docker/scripts/run-dev.sh:/run-dev.sh' + - './docker/fixtures:/fixtures' cap_add: - SYS_PTRACE ulimits: @@ -14,8 +14,10 @@ x-kuzzle-config: &kuzzle-config sysctls: - net.core.somaxconn=8192 depends_on: - - redis - - elasticsearch + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy environment: - kuzzle_services__storageEngine__client__node=http://elasticsearch:9200 - kuzzle_services__storageEngine__commonMapping__dynamic=true @@ -49,7 +51,7 @@ services: - kuzzle_node_2 - kuzzle_node_3 ports: - - "7512:7512" + - '7512:7512' volumes: - ./docker/nginx-dev:/etc/nginx/conf.d @@ -57,36 +59,61 @@ services: <<: *kuzzle-config container_name: kuzzle_node_1 ports: - - "17510:7512" # Kuzzle API port - - "1883:1883" # Kuzzle MQTT port - - "9229:9229" # Debug port + - '17510:7512' # Kuzzle API port + - '1883:1883' # Kuzzle MQTT port + - '9229:9229' # Debug port + healthcheck: + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + timeout: 1s + interval: 2s + retries: 10 kuzzle_node_2: <<: *kuzzle-config container_name: kuzzle_node_2 ports: - - "17511:7512" # Kuzzle API port - - "11883:1883" # Kuzzle MQTT port - - "9230:9229" # Debug port + - '17511:7512' # Kuzzle API port + - '11883:1883' # Kuzzle MQTT port + - '9230:9229' # Debug port + healthcheck: + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + timeout: 1s + interval: 2s + retries: 10 kuzzle_node_3: <<: *kuzzle-config container_name: kuzzle_node_3 ports: - - "17512:7512" # Kuzzle API port - - "11884:1883" # Kuzzle MQTT port - - "9231:9229" # Debug port + - '17512:7512' # Kuzzle API port + - '11884:1883' # Kuzzle MQTT port + - '9231:9229' # Debug port + healthcheck: + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + timeout: 1s + interval: 2s + retries: 10 redis: image: redis:6 container_name: kuzzle_redis ports: - - "6379:6379" + - '6379:6379' + healthcheck: + test: ['CMD', 'redis-cli', 'ping'] + interval: 1s + timeout: 3s + retries: 30 elasticsearch: image: kuzzleio/elasticsearch:7 container_name: kuzzle_elasticsearch ports: - - "9200:9200" + - '9200:9200' + healthcheck: + test: ['CMD', 'curl', '-f', 'http://localhost:9200'] + interval: 2s + timeout: 2s + retries: 10 ulimits: nofile: 65536 diff --git a/package.json b/package.json index bd83a6d8a5..7bc92c95db 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "test:lint:ts:fix": "eslint --max-warnings=0 --fix ./lib --ext .ts --config .eslintc-ts.json", "test:lint:js": "eslint --max-warnings=0 ./lib ./test ./features-legacy ./bin ./features ./doc/build-error-codes.js ./plugins/available/functional-test-plugin", "test:lint:js:fix": "eslint --max-warnings=0 --fix ./lib ./test ./features-legacy ./bin ./features ./doc/build-error-codes.js", - "doc-error-codes": "node -r ts-node/register doc/build-error-codes" + "doc-error-codes": "node -r ts-node/register doc/build-error-codes", + "docker:install": "docker-compose run kuzzle_node_1 npm install" }, "directories": { "lib": "lib"