GithubHelp home page GithubHelp logo

postgres_sandbox's Introduction

PostgreSQL Docker Sandbox

This repository provides a Docker-based sandbox environment for users to train with PostgreSQL without needing to install it on their system. The setup includes PostgreSQL and pgAdmin4 for database management.

Table of Contents

Getting Started

Prerequisites

Ensure you have the following installed on your system:

Installation

  1. Clone the repository:

    git clone https://github.com/sc00bid00/postgres-docker-sandbox.git
    cd postgres-docker-sandbox
  2. Set up environment variables: Ensure the .env file contains the necessary environment variables. You can customize these values as needed.

  3. Create necessary directories and start the containers:

    For Linux/MacOS:

    chmod +x setme-up.sh
    ./setme-up.sh

    For Windows:

    setme-up.bat

This will create the required directories, set permissions, and start the Docker containers.

Usage

  • pgAdmin will be accessible at http://localhost:5050

    • Login using the credentials specified in the .env file:
  • PostgreSQL will be running on the default port 5432

    • Access it using the credentials specified in the .env file:
      • Database: PGDB
      • User: PGME
      • Password: PGPW

Configuration

The .env file contains all the necessary configuration variables:

# PGADMIN LOGIN DATA
PGADMIN_DEFAULT_EMAIL=[email protected]
PGADMIN_DEFAULT_PASSWORD=PGAPW
PGADMIN_LISTEN_PORT=80

# DATABASE
HOST='postgres'
PORT=5432
POSTGRES_DB=PGDB
POSTGRES_USER=PGME
POSTGRES_PASSWORD=PGPW

# CONF
DATE_FORMAT='d.m.Y'
DECIMAL_SEP=','
THOUSAND_SEP=''
CSV_DELIMITER=';'

Feel free to customize these values according to your preferences.

Folder Structure

Here is the expected folder structure after setting up the sandbox:

postgres-docker-sandbox/
├── .env
├── docker-compose.yml
├── setme-up.sh
├── setme-up.bat
├── postgres_data/       # Directory for PostgreSQL data
├── pgadmin/             # Directory for pgAdmin data
└── README.md
  • .env: Environment variables for the setup.
  • docker-compose.yml: Docker Compose configuration file.
  • setme-up.sh: Setup script for Linux/MacOS.
  • setme-up.bat: Setup script for Windows.
  • postgres_data/: Directory where PostgreSQL will store its data.
  • pgadmin/: Directory where pgAdmin will store its data.
  • README.md: This README file.

Troubleshooting

If you encounter any issues, follow these steps:

  1. Check container logs:

    docker compose logs
  2. Restart the containers:

    docker compose down
    docker compose up
  3. Verify Docker and Docker Compose installation: Ensure you have the latest versions installed.

  4. File and directory permissions: Ensure the directories ./postgres_data and ./pgadmin have the correct permissions.

Contributing

We welcome contributions! Please fork the repository and create a pull request with your changes. Ensure your code adheres to the existing style and passes all tests.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Happy coding!

postgres_sandbox's People

Contributors

sc00bid00 avatar

Stargazers

francesco messina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.