-
Notifications
You must be signed in to change notification settings - Fork 1
Setup Mockpit via Docker
Mockpit Docker images are available on Docker Hub under sranmanpreet.
Starting from version 1.0.1-RELEASE, Mockpit provides a simplified installation process using a composite Docker image. This image combines both the mockpit-server and mockpit-client, streamlining the setup process. You can now bring up the application using just one Docker command.
To obtain the composite image for release 1.0.1, use this command:
docker pull sranmanpreet/mockpit:1.0.1-RELEASE
You'll only need to run the following command to start both the mockpit-server and mockpit-client together, binding them to their respective ports:
docker run -e "SPRING_DATASOURCE_URL=<your database jdbc url>" -e "SPRING_DATASOURCE_USERNAME=<your database username>" -e "SPRING_DATASOURCE_PASSWORD=<your database password>" -e "backendUrl=<mockpit-server url>" -p <client_port>:80 -p <server_port>:8080 sranmanpreet/mockpit:1.0.1-RELEASE
- Replace datasource properties according to your database.
- Replace <client_port> with the port at which you want to access the mockpit-client.
- Replace <server_port> with the port at which you want to access the mockpit-server.
For instance, if you downloaded version 1.0.1 and want to access the mockpit-client on port 4200 and mockpit-server on port 8080, the command becomes:
docker run -e "SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/mockpitdb" -e "SPRING_DATASOURCE_USERNAME=postgres" -e "SPRING_DATASOURCE_PASSWORD=postgres" -e "backendUrl=http://localhost:8080" -p 4200:80 -p 8080:8080 sranmanpreet/mockpit:1.0.1-RELEASE
If you prefer to use separate mockpit-server and mockpit-client images, follow these steps:
- Pull the images using these commands:
docker pull sranmanpreet/mockpit-server:<version>-RELEASE
docker pull sranmanpreet/mockpit-client:<version>-RELEASE
- Starting the Server: Use the following Docker command to start mockpit-server:-
To start the mockpit-server and bind it to a port, use the following Docker command:
docker run -e "SPRING_DATASOURCE_URL=<your databse jdbc url>" -e "SPRING_DATASOURCE_USERNAME=<your database username>" -e "SPRING_DATASOURCE_PASSWORD=<your database password>" -p <server_port>:8080 sranmanpreet/mockpit-server:<version>-RELEASE
- Starting the Client: Use this command to start mockpit-client:
docker run -p <client_port>:80 -e backendUrl=<mockpit-server url> sranmanpreet/mockpit-client:<version>-RELEASE
Mockpit will be accessible at http://localhost:4200.