version: "3.7" services: db: image: postgres:latest restart: always environment: POSTGRES_DB: postgres POSTGRES_USER: ${DB_USER} POSTGRES_PASSWORD: ${DB_PASSWORD} PGDATA: /var/lib/postgresql/data volumes: - /var/postgres-data:/var/lib/postgresql/data ports: - "5432:5432" pgadmin: image: tobi312/pgadmin4:latest restart: always environment: PGADMIN_DEFAULT_EMAIL: ${ADMIN_USER} PGADMIN_DEFAULT_PASSWORD: ${ADMIN_PASSWORD} PGADMIN_LISTEN_PORT: 80 ports: - "8080:80" volumes: - /var/pgadmin-data:/var/lib/pgadmin links: - "db:pgsql-server"