Selaa lähdekoodia

postgresql version can specify

Shao Yu Lung 5 vuotta sitten
vanhempi
säilyke
63b3d2ff14
3 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 4 1
      docker-compose.yml
  2. 1 0
      env-example
  3. 2 3
      postgres/Dockerfile

+ 4 - 1
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

+ 1 - 0
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

+ 2 - 3
postgres/Dockerfile

@@ -1,6 +1,5 @@
-FROM postgres:alpine
-
-LABEL maintainer="Ben M <git@bmagg.com>"
+ARG POSTGRES_VERSION=alpine
+FROM postgres:${POSTGRES_VERSION}
 
 CMD ["postgres"]