-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
34 lines (27 loc) · 887 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
ARG POSTGRES_VERSION=15
FROM postgres:${POSTGRES_VERSION}
ARG POSTGIS_VERSION
ENV DB_TYPE=
ENV PG_VERSION=
ENV TOTAL_MEM=
ENV CPU_COUNT=
ENV MAX_CONN=
ENV STGE_TYPE=
# Fix old postgres stretch images
COPY apt_archive_patch.sh /tmp
RUN /bin/bash /tmp/apt_archive_patch.sh
RUN rm /tmp/apt_archive_patch.sh
# PostGIS install if required
RUN if [ ! -z $POSTGIS_VERSION ]; \
then apt-get update \
&& apt-get install -y postgresql-${PG_MAJOR}-postgis-${POSTGIS_VERSION} \
&& apt-get install -y postgresql-${PG_MAJOR}-postgis-${POSTGIS_VERSION}-scripts \
&& apt-get install -y postgresql-${PG_MAJOR}-pgrouting \
&& apt-get install -y --no-install-recommends postgis \
&& rm -rf /var/lib/apt/lists/*; \
fi
# Run the rest of the commands as postgres user
USER postgres:postgres
# Scripts pgtuning
COPY pgtune.sh /tmp
COPY pgtuned.sh /docker-entrypoint-initdb.d