Commit 4d4c48cb authored by Cresson Remi's avatar Cresson Remi
Browse files

Update Dockerfile

parent 989c4f0c
No related merge requests found
Pipeline #44209 failed with stage
in 28 seconds
Showing with 43 additions and 19 deletions
+43 -19
FROM centos/postgresql-95-centos7 as pg FROM rhel8/postgresql-12 as pg
LABEL maintainer="David Bitner / Remi Cresson" LABEL maintainer="David Bitner / Remi Cresson"
ENV POSTGIS_MAJOR 3
ENV PGUSER postgres
ENV PGDATABASE postgres
ENV PGHOST localhost
ENV \ ENV \
PYTHONUNBUFFERED=1 \ PYTHONUNBUFFERED=1 \
PYTHONFAULTHANDLER=1 \ PYTHONFAULTHANDLER=1 \
...@@ -9,32 +13,52 @@ ENV \ ...@@ -9,32 +13,52 @@ ENV \
PIP_NO_CACHE_DIR=off \ PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 PIP_DEFAULT_TIMEOUT=100
USER root
RUN \ RUN \
yum install -y \ apt-get update \
git \ && apt-get install -y --no-install-recommends \
gnupg \
apt-transport-https \
debian-archive-keyring \
software-properties-common \
postgresql-$PG_MAJOR-pgtap \
postgresql-$PG_MAJOR-partman \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
build-essential \ build-essential \
python3 \ python3 \
python3-pip \ python3-pip \
python3-setuptools python3-setuptools \
RUN pip3 install -U pip setuptools packaging \ && pip3 install -U pip setuptools packaging \
&& pip3 install -U psycopg2-binary \ && pip3 install -U psycopg2-binary \
&& pip3 install -U psycopg[binary] \ && pip3 install -U psycopg[binary] \
&& pip3 install -U migra[pg] \ && pip3 install -U migra[pg] \
&& yum -y autoremove \ && apt-get remove -y apt-transport-https \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
EXPOSE 5432 EXPOSE 5432
RUN git clone https://github.com/stac-utils/pgstac \ RUN mkdir -p /docker-entrypoint-initdb.d
&& cd pgstac/pypgstac \ RUN echo "#!/bin/bash \n unset PGHOST \n pypgstac migrate" >/docker-entrypoint-initdb.d/initpgstac.sh && chmod +x /docker-entrypoint-initdb.d/initpgstac.sh
&& sed -i 's/python_requires=">=3.7"/python_requires=">=3.6"/g' setup.py \
&& sed -i 's/pydantic\[dotenv\]==1.10/pydantic\[dotenv\]==1.9/g' setup.py \ RUN mkdir -p /opt/src/pypgstac
&& cat setup.py \
&& pip install . WORKDIR /opt/src/pypgstac
ENV POSTGRESQL_USER=username COPY pypgstac /opt/src/pypgstac
ENV POSTGRESQL_PASSWORD=password
ENV POSTGRESQL_DATABASE=postgis RUN pip3 install -e /opt/src/pypgstac[psycopg]
USER postgres ENV PYTHONPATH=/opt/src/pypgstac:${PYTHONPATH}
WORKDIR /opt/src
ENV POSTGRES_USER=username
ENV POSTGRES_PASSWORD=password
ENV POSTGRES_DB=postgis
ENV PGUSER=username
ENV PGPASSWORD=password
ENV PGHOST=localhost
ENV PGDATABASE=postgis
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment