1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
services: postgres: image: docker.io/library/postgres:14-bullseye environment: - "POSTGRES_USER=cosmos" - "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" - "POSTGRES_DB=cosmos" - "PGDATA=/var/lib/postgresql/data/pgdata" ports: - 127.0.0.1:5432:5432 volumes: - type: volume source: postgres target: /var/lib/postgresql/data/pgdata volumes: postgres: