gitfrosh / lotr-api

This repository holds the code base of the API to rule them all, the Lord of the Rings api, which provides you with book, character, movie and quotes data.
https://the-one-api.dev
238 stars 66 forks source link

Fix docker #142

Closed MateuszKikmunter closed 5 months ago

MateuszKikmunter commented 5 months ago

This fixes issues with running the project on MacOS and utilizing Docker. The issue was with mounting volumes and running the backend, as well as restoring the database. The backend was crashing when running bcrypt because the container architecture didn't support the execution of the bcrypt binary. This is fixed by simply ignoring _nodemodules in a .dockerignore file and forcing Docker to fetch packages compatible with the container's architecture.

The second issue is related to mongo restore and permissions. This has been fixed by adjusting the volumes and creating dedicated Dockerfiles for all layers of the app for simplicity and clarity.