2026-04-20 17:51:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -euo pipefail
|
2026-04-21 08:59:09 +00:00
|
|
|
source ./modules_OCA.env
|
2026-04-20 17:51:59 +00:00
|
|
|
|
|
|
|
|
DIR=./config-postgresql
|
|
|
|
|
|
|
|
|
|
mkdir -p "$DIR"
|
|
|
|
|
|
|
|
|
|
cat > "$DIR/Dockerfile" <<EOF
|
|
|
|
|
# Utiliser l'image officielle PostgreSQL 15
|
|
|
|
|
FROM postgres:15
|
|
|
|
|
|
|
|
|
|
# Changer le port d'écoute dans la configuration PostgreSQL
|
2026-04-21 08:59:09 +00:00
|
|
|
RUN sed -i 's/^#port = 5432/port = $POSTGRESQL_PORT/' /usr/share/postgresql/postgresql.conf.sample
|
2026-04-20 17:51:59 +00:00
|
|
|
|
|
|
|
|
# Copier la configuration dans le répertoire de configuration PostgreSQL
|
|
|
|
|
CMD ["postgres", "-c", "config_file=/usr/share/postgresql/postgresql.conf.sample"]
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
sed -i -E "s/^([[:space:]]*)db_port[[:space:]]*=.*/\1db_port = $NEW_PORT/" ./odoo.conf
|
|
|
|
|
|
2026-04-21 08:59:09 +00:00
|
|
|
sed -i "s/postgres15-5434/postgres15-$POSTGRESQL_PORT/g" ./docker-compose.yml
|
2026-04-20 17:51:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-04-05 08:52:57 +00:00
|
|
|
docker build \
|
2026-04-20 17:51:59 +00:00
|
|
|
-f "$DIR/Dockerfile" \
|
2026-04-21 09:02:56 +00:00
|
|
|
-t "postgres15-$POSTGRESQL_PORT-image" .
|