forked from stac-utils/pgstac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (38 loc) · 1.48 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
FROM postgres:15-bullseye as pg
ENV PGSTACDOCKER=1
ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.3.3+dfsg-1~exp1.pgdg110+1
ENV PYTHONPATH=/opt/src/pypgstac:/opt/python:${PYTHONPATH}
ENV PATH=/opt/bin:${PATH}
ENV PYTHONWRITEBYTECODE=1
ENV PYTHONBUFFERED=1
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR
RUN set -ex \
&& apt-get install -y --no-install-recommends \
ca-certificates \
python3 python-is-python3 python3-pip \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
postgresql-$PG_MAJOR-pgtap \
postgresql-$PG_MAJOR-partman \
postgresql-$PG_MAJOR-plpgsql-check \
&& apt-get remove -y apt-transport-https \
&& apt-get clean && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /opt/src/pypgstac/pypgstac \
&& touch /opt/src/pypgstac/pypgstac/__init__.py \
&& touch /opt/src/pypgstac/README.md \
&& echo '__version__ = "0.0.0"' > /opt/src/pypgstac/pypgstac/version.py
COPY ./src/pypgstac/pyproject.toml /opt/src/pypgstac/pyproject.toml
RUN \
pip3 install --upgrade pip \
&& pip3 install /opt/src/pypgstac[dev,test,psycopg]
COPY ./src /opt/src
COPY ./scripts/bin /opt/bin
RUN \
echo "initpgstac" > /docker-entrypoint-initdb.d/999_initpgstac.sh \
&& chmod +x /docker-entrypoint-initdb.d/999_initpgstac.sh \
&& chmod +x /opt/bin/*
WORKDIR /opt/src