From 63b3d2ff14b58ee582d1b462397082f6cde2ce48 Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Thu, 6 Feb 2020 23:58:07 +0800 Subject: [PATCH] postgresql version can specify --- docker-compose.yml | 5 ++++- env-example | 1 + postgres/Dockerfile | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1aabe823..3c4f8439 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -469,7 +469,10 @@ services: ### PostgreSQL ########################################### postgres: - build: ./postgres + build: + context: ./postgres + args: + - POSTGRES_VERSION=${POSTGRES_VERSION} volumes: - ${DATA_PATH_HOST}/postgres:/var/lib/postgresql/data - ${POSTGRES_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d diff --git a/env-example b/env-example index fd14dc2e..dbbbdf55 100644 --- a/env-example +++ b/env-example @@ -316,6 +316,7 @@ MARIADB_ENTRYPOINT_INITDB=./mariadb/docker-entrypoint-initdb.d ### POSTGRES ############################################## +POSTGRES_VERSION=alpine POSTGRES_DB=default POSTGRES_USER=default POSTGRES_PASSWORD=secret diff --git a/postgres/Dockerfile b/postgres/Dockerfile index b5f121c5..67b5ea29 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -1,6 +1,5 @@ -FROM postgres:alpine - -LABEL maintainer="Ben M " +ARG POSTGRES_VERSION=alpine +FROM postgres:${POSTGRES_VERSION} CMD ["postgres"]