Setting Up Postgres (Docker)
To set up Postgres in Docker use this Docker Compose file
tip
Create Docker Network proxy
sudo docker network create proxy
docker-compose.yml
networks:
proxy:
external: true
services:
db:
hostname: platformdb_0
container_name: platformdb_0
image: postgres:16.2-bookworm
restart: always
networks:
- proxy
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=username
- POSTGRES_DB=db
ports:
- 5432:5432
volumes:
- ./data:/var/lib/postgresql/data