version: '3.8' services: db: image: postgres restart: always ports: - "5432:5432" environment: POSTGRES_PASSWORD: example volumes: - ./docker-entrypoint-sql:/docker-entrypoint-initdb.d - ./postgres-data:/var/lib/postgresql/data