Skip to content

Postgres

postgres tags

docker-compose.yml

YAML
services:
  postgres:
    image: postgres:15-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_USER=someuser
      - POSTGRES_PASSWORD=passwordhere
   ports:
     - 5432:5432
    volumes:
      - ./postgres-db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 1s
      timeout: 5s
      retries: 10

networks:
  default:
    external: true
    name: example-net