forked from senko/cijene-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.postgres
More file actions
30 lines (28 loc) · 1.32 KB
/
Dockerfile.postgres
File metadata and controls
30 lines (28 loc) · 1.32 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
# We recommend using a stable version like 16 instead of the development version 17
# for better extension compatibility and stability.
FROM postgis/postgis:16-3.4
# The pgvector extension needs to be installed.
# The package name must match the PostgreSQL version (e.g., postgresql-16-pgvector for PG16).
# We also need build-essential and git to compile it from source if a pre-built package isn't available.
# Let's try the packaged version first as it's cleaner.
# Switch to root user to install packages
USER root
# Add PostgreSQL APT repository and install pgvector and hunspell
RUN apt-get update && \
apt-get install -y --no-install-recommends \
lsb-release \
curl \
gnupg && \
curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null && \
echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
postgresql-16-pgvector \
hunspell-tools \
hunspell-hr \
&& rm -rf /var/lib/apt/lists/*
ENV PGDATA=/var/lib/postgresql/data/pgdata
# Copy the psql.sql schema file into the container
COPY service/db/psql.sql /app/service/db/psql.sql
# Switch back to the default postgres user
USER postgres