Call-for-Code-for-Racial-Justice / Legit-Info

"Legit Info" app helps residents understand the impact of legislation and policies based on their country, state, county, city, district location
Apache License 2.0
67 stars 74 forks source link

src: add docker build action #122

Closed ghost closed 3 years ago

ghost commented 3 years ago

Contributes to #120

What did you do?

Add github action to build, lint and test Dockerfile

Why did you do it?

Open issue request

How have you tested it?

Locally and on github

Were docs updated if needed?

Type of change

Checklist:

upkarlidder commented 3 years ago

@arianahl it still fails for some reason even though hadolint passes. I am trying to debug.

https://github.com/Call-for-Code-for-Racial-Justice/Legit-Info/runs/4055827296?check_suite_focus=true

Run docker run --rm --name legitinfo-test -d legitinfo
  docker run --rm --name legitinfo-test -d legitinfo
  sleep 5
  STATUS_CODE=$(docker exec legitinfo-test curl -s -o /dev/null -w "%{http_code}" localhost:8080/health/)
  docker stop legitinfo-test
  echo $STATUS_CODE | grep -q 200
  shell: /usr/bin/bash -e {0}
7825d842276902a0f4791b0e7f20ddbfdfb257ceaededc96f77787bb3b493905
Error: Process completed with exit code 7.
ghost commented 3 years ago

@upkarlidder Looks like it needed a bit longer for the app to be ready and consistently go green. I increased it to sleep 10 and I can see it went green on my fork: https://github.com/arianahl/Legit-Info/runs/4059270384?check_suite_focus=true