Skip to main content

Postgres

services:
  db:
    container_name: nome-univoco
    image: immagine desiderata (tipo: postgres:16-alpine)

    ports:
      - "60002:5432"
# oppure
    expose:
      - "5432/tcp"

    volumes:
      - ./db-data:/var/lib/postgresql/data

    restart: always

    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
      interval: 5s
      timeout: 5s
      retries: 5