One of the newest feature of Grizzly API is exporting your microservice as docker, in this secton we will present the process of this export.
- Considering you have already created your microservice you can now export one of its versions via the Export Docker button in the microservice section.
- You have to specify the version and you can add a custom tag and a description to your docker image. once you validated your export a new item will be added to table specifying the state and the uri of your image.
As marked in the How to use modal there’s multiple ways of running your docker. In this section we will explain how to run your image with basic docker commands and by using docker compose.
Once your image have switched from pending state to running you can execute the commands down below to run your image:
- Pull image
docker pull <repository URI>
- Once your image is pulled you can run it now these command require two arguments databaseURI ,databaseName which needs to be mongoDB.Also you can add your image name and its optional. These command allows you also to pull and run your image in one single step. Your image will run by default on port 8050
docker run -p 8050:8050 --env "databaseUri=<databaseUri>" --env "databaseName=<databaseName>" --name=<imageCustomName> <repository URI>
This is the simplest way of running your image in one single step. You’ll need just to download the docker-compose.yml file, then you have to run the docker-compose up -d command in the same repository of your lately downloaded file.