https://github.com/diego-paris/postgres-docker
Quickly spin up a Postgres database using Docker Compose
https://github.com/diego-paris/postgres-docker
docker docker-compose postgresql
Last synced: 2 months ago
JSON representation
Quickly spin up a Postgres database using Docker Compose
- Host: GitHub
- URL: https://github.com/diego-paris/postgres-docker
- Owner: Diego-Paris
- Created: 2023-08-29T21:46:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T01:43:42.000Z (almost 3 years ago)
- Last Synced: 2025-06-04T12:43:12.057Z (about 1 year ago)
- Topics: docker, docker-compose, postgresql
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PostgreSQL using Docker Compose
This project let's you quickly spin up a PostgreSQL Docker container using Docker Compose from the terminal for local development and learning purposes.
## Prerequisites
You need to have Docker Engine and Docker Compose on your machine.
You can install [Docker Desktop](https://docs.docker.com/desktop/) which includes both Docker Engine and Docker Compose
## How to run
```bash
# Make sure Docker Desktop is running
# Run docker compose
$ docker-compose up -d
# or
$ docker compose up -d
```
## How to check database
```bash
# Check running containers
$ docker ps
```
## How to turn off database
```bash
# Turn off database, data will be saved
$ docker-compose down
# or
$ docker compose down
```
## How to connect
You can connect to your new database using your favorite database tool. Two great options are [pgAdmin 4](https://www.pgadmin.org/) and [DataGrip](https://www.jetbrains.com/datagrip/). You can also connect from the command line using [psql](https://www.timescale.com/blog/how-to-install-psql-on-mac-ubuntu-debian-windows/).
```yaml
# Information needed to connect to your database
# All of this can be changed inside of docker-compose.yml
Hostname/Address: localhost
Port: 5555
Username: postgres
Password: password
```
### Notes
This project is for learning and local development purposes only. This is not intended for a production environment.