OWASP/crAPI

api.mypremiumdealership.com is unhealthy and crapi-web does not load

minnoc opened this issue · 1 comments

minnoc commented

Describe the bug
Using docker compose file for pre-built linux image. After running thru steps, the api.mypremiumdealership.com container is unhealthy and crapi-web does not load.

To Reproduce
using either dev or main branch steps under pre-built linux images yield the same results

Expected behavior
Expect to be able to load the crapi-web on port 8888 and status of containers to be healthy

Runtime Environment
Sytem/Environemnt information (e.g Output of docker -v and uname -a)
Docker version 24.0.5, build ced0996
Docker Compose version v2.20.2
Linux xxx-vm 5.15.0-1042-azure #49-Ubuntu SMP Tue Jul 11 17:28:46 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

~/crAPI$ sudo docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
api.mypremiumdealership.com crapi/gateway-service:develop "/app/server" api.mypremiumdealership.com 16 minutes ago Up 16 minutes (unhealthy) 443/tcp
crapi-community crapi/crapi-community:develop "/bin/sh -c /app/main" crapi-community 16 minutes ago Up 15 minutes (healthy)
crapi-identity crapi/crapi-identity:develop "/entrypoint.sh" crapi-identity 16 minutes ago Up 16 minutes (healthy)
crapi-web crapi/crapi-web:develop "/bin/sh -c /etc/ngi…" crapi-web 16 minutes ago Up 14 minutes (healthy) 127.0.0.1:8888->80/tcp, 127.0.0.1:8443->443/tcp
crapi-workshop crapi/crapi-workshop:develop "/bin/sh -c /app/run…" crapi-workshop 16 minutes ago Up 15 minutes (healthy)
mailhog crapi/mailhog:develop "MailHog" mailhog 16 minutes ago Up 16 minutes (healthy) 1025/tcp, 127.0.0.1:8025->8025/tcp
postgresdb postgres:14 "docker-entrypoint.s…" postgresdb 16 minutes ago Up 16 minutes (healthy) 5432/tcp

--

~/crAPI$ sudo docker compose logs api.mypremiumdealership.com
api.mypremiumdealership.com | 2023/08/04 14:43:47 Listening on :443

--

~/crAPI$ sudo docker compose logs crapi-web
crapi-web | total 16
crapi-web | drwxr-xr-x 2 root root 4096 Jul 3 07:05 .
crapi-web | drwxr-xr-x 1 root root 4096 Jul 3 07:13 ..
crapi-web | -rw-r--r-- 1 root root 2240 Jul 3 07:05 server.crt
crapi-web | -rw-r--r-- 1 root root 3272 Jul 3 07:05 server.key
crapi-web | WORKSHOP_SERVICE=crapi-workshop:8000
crapi-web | HOSTNAME=2775ef6bcf0a
crapi-web | SHLVL=2
crapi-web | HOME=/root
crapi-web | HTTP_PROTOCOL=http
crapi-web | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
crapi-web | COMMUNITY_SERVICE=crapi-community:8087
crapi-web | TLS_ENABLED=false
crapi-web | IDENTITY_SERVICE=crapi-identity:8080
crapi-web | PWD=/
crapi-web | NGINX_TEMPLATE=/etc/nginx/conf.d/default.conf.template
crapi-web | 2023/08/04 14:45:39 [warn] 10#10: duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:25
crapi-web | nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:25
crapi-web | 2023/08/04 14:45:39 [warn] 10#10: duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:56
crapi-web | nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:56
crapi-web | 2023/08/04 14:45:39 [warn] 10#10: duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:98
crapi-web | nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:98
crapi-web | 2023/08/04 14:45:39 [warn] 10#10: duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:129
crapi-web | nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/conf.d/default.conf:129
crapi-web | 127.0.0.1 - - [04/Aug/2023:14:45:53 +0000] "GET /web/health HTTP/1.1" 200 2835 "-" "curl/7.79.1"
crapi-web | 127.0.0.1 - - [04/Aug/2023:14:46:08 +0000] "GET /web/health HTTP/1.1" 200 2835 "-" "curl/7.79.1"

Seems to be due to mixing of compose from develop and using the latest version.