odoov18-compta/1.3.CreationDockerfile.postgres.sh
2026-05-28 08:21:31 +02:00

19 lines
No EOL
592 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
source ./0.variables.env
# Création du Dockerfile de Postgresql
POSTGRESQL_DIR=./config-postgresql
mkdir -p "$POSTGRESQL_DIR"
cat > "$POSTGRESQL_DIR/Dockerfile" <<EOF
# Utiliser l'image officielle PostgreSQL 15
FROM postgres:15
# Changer le port d'écoute dans la configuration PostgreSQL
RUN sed -i 's/^#port = 5432/port = $POSTGRESQL_PORT/' /usr/share/postgresql/postgresql.conf.sample
# Copier la configuration dans le répertoire de configuration PostgreSQL
CMD ["postgres", "-c", "config_file=/usr/share/postgresql/postgresql.conf.sample"]
EOF