folio-org / mod-reporting

Interface to Metadb/LDP reporting databases (plug-compatible reimplementation of mod-ldp)
Apache License 2.0
0 stars 1 forks source link

Modify Dockerfile for containerizing mod-reporting #12

Closed MikeTaylor closed 11 months ago

MikeTaylor commented 1 year ago

This will likely be our first dockerizations of a Go problem — but check with Nassib whether we've done it for MetaDB.

MikeTaylor commented 11 months ago

See example Go-based Dockerization at of edge-slnp at https://github.com/indexdata/edge-slnp/blob/main/Dockerfile

MikeTaylor commented 11 months ago

This is perplexing. I have a Dockerfile, which builds successfully using

docker build -t mod-reporting .

Then I run it with

docker run -p 12369:12369 -e OKAPI_PW=[DIKU_ADMIN-PASSWORD] admin mod-reporting

This should wire the port 12369 out to the host system. But when I connect to it, that connecting just shuts immediately:

host$ curl http://localhost:12369
curl: (52) Empty reply from server
host$ 

However, when I run the same command inside the container, I get a sane response:

host$ docker exec fa7a1f8b2569 curl http://localhost:12369
This is <a href="https://github.com/indexdata/mod-reporting">mod-reporting</a>. Try:
<ul>
  <li><a href="/admin/health">Health check</a></li>
  <li><a href="/htdocs/">Static area</a></li>
  <li><a href="/ldp/config">Legacy configuration WSAPI</a></li>
  <li><a href="/ldp/db/tables">List tables from reporting database</a></li>
  <li><a href="/ldp/db/columns?schema=folio_users&table=users">List columns for "users" table</a></li>
</ul>
host$ 

I am obviously doing something obviously and stupidly wrong with the port-forwarding, but I lack the Docker experience to know what.

MikeTaylor commented 11 months ago

Fixed, thanks to @wafschneider.

No doubt we will need to tweak the Dockerization of this module as we find out more about how it works in practice, but the core of the work is now done.