manulera / ShareYourCloning_frontend

The frontend application for ShareYourCloning
MIT License
1 stars 4 forks source link

fetching mime.types #293

Closed NicolasCARPi closed 1 week ago

NicolasCARPi commented 1 week ago

Hello,

I noticed that the Dockerfile fetches a mime.types file from the internet:

RUN curl https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types > mime.types

It is then given as option to http-server. Is there a reason for this? http-server depends on the mime package, albeit an old version (v1 vs current v4), maybe updating this dependency could resolve the need for another one?

Another point is that you could maybe use the files in /usr/share/mime. Couldn't find one with the same syntax though.

You can also use ADD instead of installing curl to fetch a resource on the internet.

Cheers, ~Nico

manulera commented 1 week ago

Good catch!

Fetching the mime types was something that I tried when I was trying to make it work in the iframe. It was not the problem, but I forgot to remove it. Thanks for noticing. I removed it now and installed mime@4 from npm.

NicolasCARPi commented 1 week ago

You don't need to install mime4, you'll want to open a PR on http-server to update it there, because that's what it'll be using.

manulera commented 1 week ago

In any case http-server is not used (or retained) on the image you will be using. A global http-server is only used when serving the frontend from the frontend container.

In the container you are using, everything is served with uvicorn (api + frontend).