Skip to content

Container reinit database on rebuild #761

@kpeter477

Description

@kpeter477

I have the following docker-compose script which resets the whole database server to initial state when I run docker-compose build:

postgres:
    image: postgres:12
    mem_limit: 2048M
    mem_reservation: 300M
    environment:
      POSTGRES_PASSWORD: abcd
    restart: unless-stopped
    volumes:
      - /data/erp/db:/var/lib/postgresql
    networks:
      - app_net
    ports:
      - 5432:5432

How can I avoid this? Nothing is removing content on the host.

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