Fix the healthcheck port and add `curl` to the fidesctl container
See original GitHub issueWith the recent update, ‘docker-compose up -d’ did not start postgre database properly. Also, fidesctl container becomes unhealthy. I am suggesting the following change to address these issues.
- add
./
like- ./postgres-data:/var/lib/postgresql/data
volume mapping - install
curl
in fidesctl container - correct healthcheck test so it refers to 8080 instead of 8000
diff --git a/.gitignore b/.gitignore
index 5435b80..ed9ec1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -207,3 +207,6 @@ venv.bak/
.mypy_cache/
.dmypy.json
dmypy.json
+
+# postresSQL data
+postgres-data/
diff --git a/docker-compose.yml b/docker-compose.yml
index b753e35..3a64874 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,7 +5,7 @@ services:
dockerfile: Dockerfile
command: uvicorn --host 0.0.0.0 --port 8080 --reload fidesapi.main:app
healthcheck:
- test: ["CMD", "curl", "-f", "http://0.0.0.0:8000/health"]
+ test: ["CMD", "curl", "-f", "http://0.0.0.0:8080/health"]
interval: 5s
timeout: 5s
retries: 5
@@ -32,7 +32,7 @@ services:
timeout: 5s
retries: 5
volumes:
- - postgres:/var/lib/postgresql/data
+ - ./postgres-data:/var/lib/postgresql/data
expose:
- 5432
ports:
diff --git a/fidesctl/Dockerfile b/fidesctl/Dockerfile
index 16bf4af..02f9c8b 100644
--- a/fidesctl/Dockerfile
+++ b/fidesctl/Dockerfile
@@ -3,6 +3,7 @@ FROM python:3.8-slim-buster
# Install auxiliary software
RUN apt-get update
RUN apt-get install -y \
+ curl \
git \
ipython \
make \
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
APIv2 healthcheck: hang while cURLing when the ...
The cURL command will hang when using APIv2 for healthcheck. And there will be a process podman heathcheck run ..... always running in...
Read more >adding health check to docker container - nginx
I gave up on using the HEALTHCHECK command in Dockerfile and instead I am changing the nginx.conf file by adding
Read more >How To Successfully Implement A Healthcheck In Docker ...
Configure a health check within the compose file. As an example, the docker-compose.very-simple-web.yml will be extended by a simple curl based ...
Read more >Troubleshoot Amazon ECS task container health check ...
My Amazon Elastic Container Service (Amazon ECS) task is failing the container heath check. How do I resolve this?
Read more >Docker healthchecks: why you shouldn't use `curl` or `iwr`
Most HEALTHCHECK examples use curl on Linux and iwr on Windows. That adds a dependency on an external tool and limits portability.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oh I see, sorry about that! We should’ve added a note about that change
We’ve also updated the installation guide and quick starts to not point end-users at the development
docker-compose.yml
andMakefile
, this increases stability for end-users as well. https://ethyca.github.io/fides/installation/installation/So in summary, for this issue we’ll go ahead and fix the
healthcheck
port as well as addcurl
to the container for better debuggingfyi @earmenda
@earmenda i just went ahead and made these changes in #236 since they’re small and I needed to fix the health check for the testing I was doing anyway 😃