Deck Plan Files Server¶
This service is an NGINX container with the bare minimum and essentials for serving static files. It will be used by Deck Plan to obtain the necessary images to show the different general arrangements interactively as a map.
Local Docker Build¶
Currently all the scripts from the new compose approach don't work, so we had to came up with a workaround to build the images locally until we can improve the development loop for this image.
To perform a new local build of the file server image, we would need to add the
following lines at the docker-compose.yml
file:
YAML | |
---|---|
Important
After modifying the file, make sure to not commit those changes as they might break the environment. Also, make sure to have deleted the image/container if it has been created previously.
Once the file has been modified, at the dotnet folder, use the following command:
Bash | |
---|---|
Important
This is because if we perform a build-image in the folder of the deck plan file server, it will prompt that we don't have a container-env file. Which wouldn't work anyway if we add it anyway. Also, if we execute the compose command without the aforementioned lines, docker will try to pull the image instead of build it.
GOTCHAs¶
The files currently used have been uploaded to Office 365, source.
How to add or remove files from the Docker image¶
- To add new files, insert the desired images into the folder
./dotnet/docker/deck-plan-file-server/images
and then rebuild the image. The images will be copied to/usr/share/nginx/html
and served from there. To verify that the images have been added correctly you can access {FileServerURI}/{image-path}. - To remove files, make sure that the files are not in the
./dotnet/docker/deck-plan-file-server/images
folder before building the image.
For Example: If you add an image whose path is "./images/Vessels/Vessel1.png"
the url to access to that image will be {FileServerURI}/Vessels/Vessel1.png
For both adding and removing, we will need to build the image locally, so make sure to follow the steps from the previous section.
Considerations¶
- To corroborate the file server is working as we intend to, we have to access any file using the Deck Plan BFF at any browser. Example: https://{DECKPLANBFFURI}/api/images/{ImageFromFileServer}
- To work properly, the image/container of the file server has to be created under the network of the compose, otherwise it will not work in the BFF.