This project includes building a Go application with a PostgreSQL database using Docker Compose.
Make sure you have Docker and Docker Compose installed on your system.
-
Clone this repository to your local machine.
-
Update the environment variables in the
docker-compose.yml
file:POSTGRES_USER
: Username for PostgreSQL database.POSTGRES_PASSWORD
: Password for PostgreSQL database.POSTGRES_DB
: Name of the PostgreSQL database.
-
Build and run the project using the following command:
docker-compose up --build
-
Access the API documentation at http://localhost:8080/swagger/index.html#/
-
You can now interact with the API endpoints as documented in the Swagger UI.
To set up the PostgreSQL database, you can customize the following environment variables in the docker-compose.yml
file:
POSTGRES_USER
: Replaceuser
with your desired username.POSTGRES_PASSWORD
: Replacepassword
with your desired password.POSTGRES_DB
: Replacedatabase
with your desired database name.