forked from entando/entando-postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ubi8
41 lines (31 loc) · 1.43 KB
/
Dockerfile.ubi8
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
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4-200
ENV PGDATA /var/lib/pgsql/data/userdata
ENV PGUSER postgres
ENV POSTGRESQL_USER=${POSTGRESQL_USER}
ENV POSTGRESQL_PASSWORD=${POSTGRESQL_PASSWORD}
ENV POSTGRESQL_DATABASE=${POSTGRESQL_DATABASE}
ENV POSTGRESQL_ADMIN_PASSWORD=${POSTGRESQL_ADMIN_PASSWORD}
ENV PATH $PATH:$PGDATA
RUN microdnf install -y dnf && \
dnf update -y && \
dnf install -y \
langpacks-en glibc-all-langpacks -y \
https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8-x86_64/postgresql14-server-14.1-1PGDG.rhel8.x86_64.rpm \
https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8-x86_64/postgresql14-libs-14.1-1PGDG.rhel8.x86_64.rpm \
https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8-x86_64/postgresql14-14.1-1PGDG.rhel8.x86_64.rpm \
https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8-x86_64/postgresql14-contrib-14.1-1PGDG.rhel8.x86_64.rpm
COPY docker-entrypoint.sh /
COPY check-container /usr/libexec/
RUN chmod a+xr /docker-entrypoint.sh \
&& usermod -a -G root postgres \
&& chgrp -R root "/var/lib/pgsql/" \
&& chmod g+rwX "/var/lib/pgsql/" \
&& chgrp -R root "/var/run/postgresql" \
&& chmod g+rw "/var/run/postgresql" \
&& chmod ug+x "/usr/libexec/check-container" \
;
USER 26
ENTRYPOINT ["/docker-entrypoint.sh"]
STOPSIGNAL SIGINT
EXPOSE 5432
CMD ["/usr/pgsql-14/bin/postgres"]