-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (35 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
39 lines (35 loc) · 1.12 KB
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
FROM registry.drycc.cc/drycc/base:bullseye
COPY rootfs/usr /usr/
COPY rootfs/entrypoint.sh /entrypoint.sh
ENV PYTHON_VERSION="3.10.4" \
PG_MAJOR=14 \
POSTGRESQL_VERSION="14.2"
ENV PGDATA /data/${PG_MAJOR}
RUN install-packages gcc \
&& install-stack python $PYTHON_VERSION \
&& install-stack postgresql $POSTGRESQL_VERSION \
&& . init-stack \
&& set -eux; pip3 install --disable-pip-version-check --no-cache-dir psycopg[binary] patroni[kubernetes] 2>/dev/null; set +eux \
&& apt-get purge -y --auto-remove gcc \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf \
/usr/share/doc \
/usr/share/man \
/usr/share/info \
/usr/share/locale \
/var/lib/apt/lists/* \
/var/log/* \
/var/cache/debconf/* \
/etc/systemd \
/lib/lsb \
/lib/udev \
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \
&& mkdir -p /usr/share/man/man{1..8} \
&& mkdir -p $PGDATA \
&& groupadd postgres && useradd -g postgres postgres \
&& chown -R postgres:postgres /data
USER postgres
ENTRYPOINT ["init-stack", "/entrypoint.sh"]
EXPOSE 5432 8008