diff --git a/.github/workflows/docker-crawlab.yml b/.github/workflows/docker-crawlab.yml index b4da93b6..8db9df67 100644 --- a/.github/workflows/docker-crawlab.yml +++ b/.github/workflows/docker-crawlab.yml @@ -304,23 +304,11 @@ jobs: CRAWLAB_MONGO_PORT: 27017 ports: - 8080:8080 - options: >- - --health-cmd "curl -f http://localhost:8080/api/health || exit 1" - --health-interval 30s - --health-timeout 10s - --health-retries 5 worker: image: ghcr.io/${{ github.repository_owner }}/crawlab:${{ needs.setup.outputs.version }} env: CRAWLAB_NODE_MASTER: N CRAWLAB_MASTER_HOST: master - ports: - - 8001:8000 - options: >- - --health-cmd "curl -f http://localhost:8001/health || exit 1" - --health-interval 30s - --health-timeout 10s - --health-retries 5 steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index adbc2281..c60dfaa6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,3 +26,10 @@ COPY ./docker/bin/* /app/bin # start backend CMD ["/bin/bash", "/app/bin/docker-init.sh"] + +# frontend port +EXPOSE 8080 + +# healthcheck for backend +HEALTHCHECK --interval=1m --timeout=3s \ + CMD curl -f http://localhost:8000/health || exit 1 \ No newline at end of file diff --git a/docker/ghcr/.docker-compose.yml.swp b/docker/ghcr/.docker-compose.yml.swp new file mode 100644 index 00000000..fe323879 Binary files /dev/null and b/docker/ghcr/.docker-compose.yml.swp differ diff --git a/docker/ghcr/docker-compose.yml b/docker/ghcr/docker-compose.yml index e33a868f..8cf732c7 100644 --- a/docker/ghcr/docker-compose.yml +++ b/docker/ghcr/docker-compose.yml @@ -11,7 +11,7 @@ services: depends_on: - mongo healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health", "||", "exit", "1"] + test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 5 @@ -25,7 +25,7 @@ services: depends_on: - master healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health", "||", "exit", "1"] + test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 5