Files
tp/postgresql.md

56 lines
1.1 KiB
Markdown
Raw Normal View History

2025-11-20 20:12:55 +01:00
# PostgreSQL
## Debian
2025-11-15 13:48:12 +01:00
2025-11-17 22:01:03 +01:00
```shell
sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt install postgresql-18
```
2025-11-15 13:48:12 +01:00
## Docker
```shell
docker network create pgsql_net
```
2025-11-27 07:40:19 +01:00
```shell
2025-11-27 09:45:43 +01:00
docker build -t iut/pgsql:2025-13 \ -f postgresql.Dockerfile .
2025-11-27 07:40:19 +01:00
```
2025-11-15 13:48:12 +01:00
```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 \
2025-11-17 22:01:03 +01:00
-v "./:/docker-entrypoint-initdb.d" \
2025-11-27 07:40:19 +01:00
iut/pgsql:2025-13
2025-11-15 13:48:12 +01:00
```
## pgAdmin
2025-11-21 13:46:08 +01:00
```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" \
2025-11-27 07:40:19 +01:00
dpage/pgadmin4:9.10
2025-11-21 13:46:08 +01:00
```
2025-11-18 12:03:54 +01:00
```
2025-11-06 07:44:45 +01:00
restart: "no"
configs:
- source: pgadmin_config
target: /pgadmin4/servers.json
2025-11-18 12:03:54 +01:00
```