-
Notifications
You must be signed in to change notification settings - Fork 1
/
__Dockerfile
46 lines (40 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
46
FROM postgres:15.4-bullseye
# Do not split the description, otherwise we will see a blank space in the labels
LABEL name="PostgreSQL Container Images" \
vendor="The CloudNativePG Contributors" \
version="${PG_VERSION}" \
release="10" \
summary="PostgreSQL Container images." \
description="This Docker image contains PostgreSQL and Barman Cloud based on Postgres 15.4-bullseye."
LABEL org.opencontainers.image.description="This Docker image contains PostgreSQL and Barman Cloud based on Postgres 15.4-bullseye."
COPY requirements.txt /
# Install additional extensions
RUN set -xe; \
apt-get update; \
apt-get install -y --no-install-recommends \
"postgresql-${PG_MAJOR}-pgaudit" \
"postgresql-${PG_MAJOR}-pgvector" \
"postgresql-${PG_MAJOR}-pg-failover-slots" \
"postgresql-${PG_MAJOR}-pgsodium" \
"postgresql-${PG_MAJOR}-pg-stat-statements" \
"postgresql-${PG_MAJOR}-pgcrypto" \
"postgresql-${PG_MAJOR}-pgjwt" \
"postgresql-${PG_MAJOR}-uuid-ossp" \
; \
rm -fr /tmp/* ; \
rm -rf /var/lib/apt/lists/*;
# Install barman-cloud
RUN set -xe; \
apt-get update; \
apt-get install -y --no-install-recommends \
python3-pip \
python3-psycopg2 \
python3-setuptools \
; \
pip3 install --upgrade pip; \
# TODO: Remove --no-deps once https://github.com/pypa/pip/issues/9644 is solved
pip3 install --no-deps -r requirements.txt; \
rm -rf /var/lib/apt/lists/*;
# Change the uid of postgres to 26
RUN usermod -u 26 postgres
USER 26