Allow non-default `PGPORT` (#1363)

- Allow use of environment variables in addition to .env
- Remove .env-postgres and the need to synchronize it with .env

Resolves #1354
Related to https://github.com/openmaptiles/openmaptiles-tools/pull/403
pull/1371/head^2
zstadler 2022-04-19 22:33:03 +03:00 zatwierdzone przez GitHub
rodzic 8693822d50
commit 22915df783
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 21 dodań i 11 usunięć

2
.env
Wyświetl plik

@ -4,7 +4,7 @@
TILESET_FILE=openmaptiles.yaml
# Use 3-part patch version to ignore patch updates, e.g. 5.0.0
TOOLS_VERSION=6.1
TOOLS_VERSION=latest
# Make sure these values are in sync with the ones in .env-postgres file
PGDATABASE=openmaptiles

Wyświetl plik

@ -1,8 +0,0 @@
# This file defines environment variables for the PostgreSQL image.
# The main docker PostgreSQL image requires these vars rather than
# the standard PG* ones that all PostgreSQL tools use.
# Make sure these values are in sync with the ones in .env file
POSTGRES_DB=openmaptiles
POSTGRES_USER=openmaptiles
POSTGRES_PASSWORD=openmaptiles

Wyświetl plik

@ -18,8 +18,14 @@ services:
networks:
- postgres
ports:
- "5432"
env_file: .env-postgres
- "${PGPORT:-5432}:${PGPORT:-5432}"
env_file: .env
environment:
# postgress container uses old variable names
POSTGRES_DB: ${PGDATABASE:-openmaptiles}
POSTGRES_USER: ${PGUSER:-openmaptiles}
POSTGRES_PASSWORD: ${PGPASSWORD:-openmaptiles}
PGPORT: ${PGPORT:-5432}
import-data:
image: "openmaptiles/import-data:${TOOLS_VERSION}"
@ -44,6 +50,10 @@ services:
IMPOSM_CONFIG_FILE: ${IMPOSM_CONFIG_FILE}
# Control import-sql processes
MAX_PARALLEL_PSQL: ${MAX_PARALLEL_PSQL}
PGDATABASE: ${PGDATABASE:-openmaptiles}
PGUSER: ${PGUSER:-openmaptiles}
PGPASSWORD: ${PGPASSWORD:-openmaptiles}
PGPORT: ${PGPORT:-5432}
networks:
- postgres
volumes:
@ -71,6 +81,10 @@ services:
MBTILES_NAME: ${MBTILES_FILE}
# Control tilelive-copy threads
COPY_CONCURRENCY: ${COPY_CONCURRENCY}
PGDATABASE: ${PGDATABASE:-openmaptiles}
PGUSER: ${PGUSER:-openmaptiles}
PGPASSWORD: ${PGPASSWORD:-openmaptiles}
PGPORT: ${PGPORT:-5432}
generate-vectortiles:
image: "openmaptiles/generate-vectortiles:${TOOLS_VERSION}"
@ -88,6 +102,10 @@ services:
# Control tilelive-copy threads
COPY_CONCURRENCY: ${COPY_CONCURRENCY}
#
PGDATABASE: ${PGDATABASE:-openmaptiles}
PGUSER: ${PGUSER:-openmaptiles}
PGPASSWORD: ${PGPASSWORD:-openmaptiles}
PGPORT: ${PGPORT:-5432}
postserve:
image: "openmaptiles/openmaptiles-tools:${TOOLS_VERSION}"