# PostgreSQL ## Debian ```shell apt install -y postgresql-common /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh apt install postgresql-18 ``` ## Docker ```shell docker build -t iut/pgsql:2025-13 -f postgresql.Dockerfile . ``` ```shell docker network create pgsql_net ``` ```shell docker run --detach --name pgsql \ --network pgsql_net \ -p "5432:5432" \ -e "POSTGRES_INITDB_ARGS=--locale-provider=icu --icu-locale=fr-FR" \ -e "POSTGRES_PASSWORD=ChangeMe" \ -e "POSTGRES_USER=iut" \ -v pgsql_data:/var/lib/postgresql \ -v "./:/docker-entrypoint-initdb.d" \ iut/pgsql:2025-13 ``` ## pgAdmin ```shell docker run --detach --name pgadmin \ --network pgsql_net \ --network proxy_net \ -v "pgadmin:/var/lib/pgadmin/" \ -e "PGADMIN_DISABLE_POSTFIX=true" \ -e "PGADMIN_DEFAULT_EMAIL=p@toto.fr" \ -e "PGADMIN_DEFAULT_PASSWORD=ChangeMe" \ --label "caddy=pgadmin.localhost" \ --label "caddy.reverse_proxy={{upstreams 80}}" \ --label "caddy.tls=internal" \ dpage/pgadmin4:9.10 ``` ``` configs: - source: pgadmin_config target: /pgadmin4/servers.json ```