25 lines
614 B
Django/Jinja
25 lines
614 B
Django/Jinja
FROM almalinux:9-base
|
|
|
|
# Install PostgreSQL 16 using built-in module
|
|
RUN dnf -y update && \
|
|
dnf -y module enable postgresql:{{postsgresql_version}} && \
|
|
dnf -y install postgresql-server && \
|
|
dnf clean all
|
|
|
|
# Create directory structure without initializing
|
|
RUN mkdir -p /var/lib/pgsql/data && \
|
|
chown -R postgres:postgres /var/lib/pgsql && \
|
|
chmod 700 /var/lib/pgsql/data
|
|
|
|
# Add entrypoint script
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
USER postgres
|
|
ENV PGDATA=/var/lib/pgsql/data
|
|
EXPOSE 5432
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
CMD ["postgres", "-D", "/var/lib/pgsql/data"]
|
|
|