Using Docker Compose π³β
This guide walks you through generating tests and DB mocks for a sample CRUD app built with FastHttp and Postgres using Keploy.
Donβt have Keploy installed yet?
Before running this sample, make sure Keploy is installed on your system.
π Go to Installation GuideClone a sample CRUD application π§ͺβ
git clone https://github.com/keploy/samples-go.git && cd samples-go/fasthttp-postgres
go mod download
We will be using Docker Compose to run both the application and Postgres inside Docker containers.
Lights, Camera, Record! π₯β
Fire up the application and Postgres instance with Keploy. Keep an eye on the two key flags:
-c
: Command to run the app (e.g., docker compose up
).
--container-name
: The container name in the docker-compose.yml
for traffic interception.
keploy record -c "docker compose up" --container-name "fasthttpPostgresApp"
Keploy waits for the container to be up before intercepting. If your compose services need extra time to build or initialize, you can add
--build-delay <seconds>
to the command.
Getting logs like this? Perfect! π