version: "3"

services:
  database:
    image: "postgres"
    ports:
      - "5432:5432"
    restart: always
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=todos
    volumes:
      - database_data:/var/lib/postgresql/data
volumes:
  database_data:
    driver: local
