This repository contains the configuration to set up Mockoon and Ngrok using Docker. The setup allows you to run a mock API using Mockoon and expose it to the internet using Ngrok.
-
Register for an Ngrok Account:
- If you don't have an Ngrok account, sign up for a free account at ngrok.com.
-
Set Ngrok Authentication Token:
- Update the
config/ngrok.yaml
file with your Ngrok authentication token.
- Update the
version: "2"
authtoken: "<YOUR_NGROK_AUTH_TOKEN>"
tunnels:
mockoon:
proto: http
addr: mockoon:3000
Replace <YOUR_NGROK_AUTH_TOKEN>
with your actual Ngrok authentication token.
- Update
mockoon.json
:- If you have custom Mockoon configurations, update the
config/mockoon.json
file accordingly. You can also generate this JSON file using the Mockoon Desktop.
- If you have custom Mockoon configurations, update the
- Ensure Execution Permissions:
- Make sure the
entrypoint.sh
script has execution permissions.
- Make sure the
chmod +x entrypoint.sh
- Run Docker Compose:
- Start the services using Docker Compose. You may need to use
sudo
depending on your Docker setup.
- Start the services using Docker Compose. You may need to use
docker-compose down
docker-compose up -d
-
Ngrok URL:
- Access the Ngrok web interface:
open http://localhost:4040
- Alternatively, you can check the logs of the Ngrok container to find the public URL:
docker logs ngrok
- Access the Ngrok web interface:
-
Mockoon Logs:
- Navigate to the logs directory on your host machine:
cd ./logs
- Check the contents of
mockoon.log
:cat mockoon.log
- Navigate to the logs directory on your host machine:
By following these steps, you will have a Mockoon service running alongside an Ngrok service, providing a public URL to access your Mockoon API. This setup is useful for testing and developing mock APIs that need to be publicly accessible.