Categorygithub.com/teamcubation/go-items-challenge
module
0.0.0-20250131135004-48e5addcf994
Repository: https://github.com/teamcubation/go-items-challenge.git
Documentation: pkg.go.dev

# README

Setting Up PostgreSQL with Docker

This guide explains how to set up a PostgreSQL database using Docker. If you don't already have PostgreSQL installed locally, this is a simple and efficient way to get started.

Prerequisites

  • Docker installed on your system.
  • A .env file in the root directory to configure database credentials.

Steps to Set Up PostgreSQL with Docker

  1. Create a .env file: In the root directory of your project, create a file named .env with the following content:

    DB_HOST=localhost
    DB_PORT=5432
    DB_USER=your_username
    DB_PASSWORD=your_password
    DB_NAME=mercadolibre
    

    Replace your_username, your_password, and your_database_name with your desired PostgreSQL credentials.

  2. Start the PostgreSQL container: Run the following command to start the PostgreSQL container:

    docker-compose up -d
    
  3. Verify the setup:

    • Use the docker ps command to confirm that the PostgreSQL container is running.

    • Connect to the database using your favorite PostgreSQL client or the psql command-line tool:

      psql -h localhost -U your_username -d your_database_name
      

      Use the username and password defined in your .env file.

Notes

  • Ensure the .env file is included in your .gitignore file to avoid committing sensitive credentials.
  • Modify the port in the .env file if 5432 is already in use on your machine.

That's it! Your PostgreSQL database should now be up and running with Docker.

# Packages

No description provided by the author
Package docs Code generated by swaggo/swag.
No description provided by the author