-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile.postgresql
50 lines (42 loc) · 1.73 KB
/
Dockerfile.postgresql
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
47
48
49
50
# Copyright (C) 2024 Tim Bastin, l3montree UG (haftungsbeschränkt)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Use the official PostgreSQL image as a base
FROM postgres:16.6@sha256:c965017e1d29eb03e18a11abc25f5e3cd78cb5ac799d495922264b8489d5a3a1
# Set the maintainer
MAINTAINER Tim Bastin <tim.bastin@l3montree.com>
# Install the build dependencies
RUN apt-get update && apt-get install -y \
git \
build-essential \
postgresql-server-dev-all && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen en_US.UTF-8
# Set environment variables for locale
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Clone the pg-semver repository
RUN git clone https://github.com/theory/pg-semver.git /pg-semver
# Build and install pg-semver
RUN cd /pg-semver && \
make && \
make install
# Clean up the build dependencies to keep the image size down
RUN apt-get remove -y git build-essential postgresql-server-dev-all && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set the default command to run when starting the container
CMD ["postgres"]