This repository provides a Docker setup for deploying the File Manager as a standalone service locally. The File Manager consists of a Nextcloud instance, a custom API (Generic Layer) written in PHP, and a Flask RESTful API (Application Layer).
The Docker setup contains the following services:
- Nextcloud Instance: This service serves both the Nextcloud instance and the API.
- MariaDB Database: The Nextcloud instance depends on this database service.
- Application Layer: This service serves the Flask RESTful API.
The Nextcloud instance and the Custom API (Generic Layer) can be accessed using the following URLs:
- Nextcloud Instance:
https://localhost:8443 - Custom API (Generic Layer) Endpoints:
https://localhost:8443/api/genapi.php/{endpoint} - Application Layer Endpoints:
http://127.0.0.1:5000/api/{endpoint}
Before using this Docker setup, ensure that you have the following prerequisites installed:
- Docker: Follow the installation instructions for your operating system from the official Docker website: https://www.docker.com/get-started
- Docker Compose: Refer to the Docker Compose installation guide: https://docs.docker.com/compose/install/
Note: Avoid using the nistnet network as it may cause issues with Docker due to VPN configurations.
To set up the File Manager Docker, perform the following steps:
-
Open a terminal or command prompt.
-
Run the following command to clone the
File Manager Dockerrepository:git clone --branch standalone https://github.com/usnistgov/oar-file-manager-docker -
Navigate to this repository:
cd oar-file-manager-docker -
Make the script executable if necessary:
chmod +x start.sh -
Run the script:
./start.sh -
The File Manager should be up and running, ready to use!
To test the file manager, enter the following endpoint in a service like Postman:
- Post request to authenticate:
http://127.0.0.1:5000/api/auth - Use Basic Authentication with
API_USERandAPI_PWDvalues of the/fm/env/local.envfile. Default values areoar_apiandNISTnextcloudADMIN. - Copy the message returned, this is the JWT token to use to access all other endpoints.
- Get request to test the API:
http://127.0.0.1:5000/api/test
If the API is working correctly, you should see the response ["GET","","api","genapi.php","test"].
To stop the application, run the script:
./stop.sh