Skip to content

Multiple users with docker-compose #1149

@eldarj

Description

@eldarj

Given a simple docker-compose

version: '3.8'

services:
  psql:
    image: postgres:16-alpine
    container_name: my-psql
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=something
      - POSTGRES_PASSWORD=something
      - POSTGRES_DB=sample

What is the suggest approach for creating multiple users? Ideally with the logic in docker-compose alone. Or if not possible, perhaps with a sh script, but without custom Dockerfiles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions