docker-compose.yml
version: '3'
services:
pg:
image: postgres
container_name: pg-api-starter
ports:
- '5400:5432'
environment:
- POSTGRES_USER=docker
- POSTGRES_PASSWORD=docker
- POSTGRES_DB=api-dev
volumes:
- ./docker/pg/postgres.conf:/etc/postgresql/postgresql.conf
- ./data/pg:/var/lib/postgresql/data
command: postgres -c config_file=/etc/postgresql/postgresql.conf
networks:
- postgres
restart: always
pgadmin:
container_name: pgadmin_labs
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_SERVER_JSON_FILE: /tmp/.pgadmin/servers.json
volumes:
- ./data/pgadmin:/tmp/.pgadmin
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- postgres
restart: unless-stopped
networks:
postgres:
driver: bridge