Update Dockerfile
Browse files- Dockerfile +26 -31
Dockerfile
CHANGED
@@ -1,38 +1,33 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
9 |
git \
|
10 |
-
|
11 |
-
|
12 |
-
lsb-release \
|
13 |
-
lsof \
|
14 |
-
postgresql \
|
15 |
-
gnupg
|
16 |
-
|
17 |
-
# Install the PostgreSQL 16 repository key
|
18 |
-
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
|
19 |
-
|
20 |
-
# Install PostgreSQL 16 client and server
|
21 |
-
RUN apt-get update && apt-get install -y postgresql-client-16 postgresql-server-dev-16
|
22 |
|
23 |
-
#
|
24 |
-
RUN
|
|
|
25 |
|
26 |
-
#
|
27 |
-
|
28 |
-
|
|
|
|
|
29 |
|
30 |
-
#
|
31 |
-
|
32 |
-
|
|
|
33 |
|
34 |
-
# Expose the
|
35 |
EXPOSE 5432
|
36 |
|
37 |
-
#
|
38 |
-
|
|
|
1 |
+
FROM ubuntu:20.04
|
2 |
+
|
3 |
+
# Install dependencies
|
4 |
+
RUN apt-get update && apt-get install -y \
|
5 |
+
build-essential \
|
6 |
+
libreadline-dev \
|
7 |
+
zlib1g-dev \
|
8 |
+
libssl-dev \
|
9 |
+
libpq-dev \
|
10 |
git \
|
11 |
+
wget \
|
12 |
+
ca-certificates
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
+
# Download and extract PostgreSQL source code
|
15 |
+
RUN wget https://ftp.postgresql.org/pub/source/v14.1/postgresql-14.1.tar.gz
|
16 |
+
RUN tar -xzf postgresql-14.1.tar.gz
|
17 |
|
18 |
+
# Configure and build PostgreSQL
|
19 |
+
WORKDIR /postgresql-14.1
|
20 |
+
RUN ./configure
|
21 |
+
RUN make
|
22 |
+
RUN make install
|
23 |
|
24 |
+
# Set environment variables
|
25 |
+
ENV POSTGRES_DB=mydb
|
26 |
+
ENV POSTGRES_USER=myuser
|
27 |
+
ENV POSTGRES_PASSWORD=mypassword
|
28 |
|
29 |
+
# Expose the PostgreSQL port
|
30 |
EXPOSE 5432
|
31 |
|
32 |
+
# Start the PostgreSQL server
|
33 |
+
CMD ["postgres", "-D", "/usr/local/pgsql/data"]
|