Skip to content

Conversation

@Syedowais312
Copy link

@Syedowais312 Syedowais312 commented Dec 22, 2025

Summary

Adds Docker and Docker Compose support for the fasthttp-postgres quickstart, allowing it to be run with a single command.

Problem

Previously, running the fasthttp-postgres quickstart required:

  • Manual Go environment setup
  • A locally running PostgreSQL instance
  • Hardcoded database configuration

This made onboarding and testing the sample unnecessarily complex.

Solution

This PR containerizes both the application and the database using Docker and Docker Compose, enabling a fully reproducible and beginner-friendly setup.

Changes

  • Added a multi-stage Dockerfile for the Go application
  • Updated docker-compose to include the application service
  • Configured PostgreSQL connectivity using environment variables
  • Removed hardcoded database configuration
  • Added missing PostgreSQL driver import required by database/sql

How to Run

docker compose up

###Access

http://localhost:8080

Verification

  • Built and ran the setup using docker compose up --build

  • Verified PostgreSQL initialization and migrations

  • Confirmed successful database connection from the application

  • Verified application startup without runtime errors

Notes

  • The application connects to PostgreSQL using the Docker service name

  • No manual database setup is required

  • Changes are limited to the quickstart and do not affect existing functionality

Fixes: keploy/keploy#3405

Screenshot:
Screenshot From 2025-12-22 19-18-45

Signed-off-by: Syedowais312 <syedowais312sf@gmail.com>
@Syedowais312 Syedowais312 force-pushed the docker-fasthttp-postgres branch from 752e939 to 60fcecf Compare December 22, 2025 15:50
Signed-off-by: Syedowais312 <syedowais312sf@gmail.com>
@Syedowais312 Syedowais312 force-pushed the docker-fasthttp-postgres branch from eb0929f to 3284038 Compare December 22, 2025 15:58
Signed-off-by: Syedowais312 <syedowais312sf@gmail.com>
@Syedowais312 Syedowais312 force-pushed the docker-fasthttp-postgres branch from 7af6d65 to ead6147 Compare December 22, 2025 16:11
Copy link
Contributor

@Achanandhi-M Achanandhi-M left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Syedowais312 , the changes look good overall 👍

A couple of suggestions:

  • Please avoid using the latest Alpine image in the Dockerfile and switch to a specific version instead.

  • The README should cover two ways to run the app:

    1. Using Docker Compose
    2. Running the app without Docker
      Currently, it only documents the Docker Compose method.
  • Please remove the gocoverage command from the Keploy test command. We don’t have a gocoverage flag when running Keploy via the Docker Compose method.

@Syedowais312 Syedowais312 force-pushed the docker-fasthttp-postgres branch from e8b5e0e to 1718b4d Compare December 24, 2025 12:05
@Syedowais312
Copy link
Author

Thanks for the review @Achanandhi-M!

I’ve updated the Dockerfile to pin the Alpine base image to a specific version and added documentation for running the application without Docker.
I also fixed minor README typos and formatting for clarity.

Please let me know if any further changes are needed.

Signed-off-by: Syedowais312 <syedowais312sf@gmail.com>
@Syedowais312 Syedowais312 force-pushed the docker-fasthttp-postgres branch from b5a7320 to 66ada0f Compare December 24, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Add Dockerfile and docker-compose support for fasthttp-postgres quickstart

2 participants