pg.ddx.io pgvector/pgvector GitHub issues and pull requests
help / color / mirror / Atom feed[pgvector/pgvector] PR #739: Adds docker image based on fly io pgsql image
3+ messages / 1 participants
[nested] [flat]
* [pgvector/pgvector] PR #739: Adds docker image based on fly io pgsql image
@ 2024-12-26 19:00 "farmisen (@farmisen)" <noreply+farmisen@github.com>
0 siblings, 0 replies; 3+ messages in thread
From: farmisen (@farmisen) @ 2024-12-26 19:00 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Adds Fly.io PostgreSQL support with custom Dockerfile and deployment documentation
This change introduces Fly.io-specific Docker configuration and documentation for deploying PostgreSQL with pgvector extension. It modifies the base image from standard postgres:17 to flyio/postgres-flex:16 and adds comprehensive deployment instructions.
### Changes
- Modified base Dockerfile to use flyio/postgres-flex:16 instead of postgres:17
- Added new Dockerfile-fly specifically for Fly.io deployments
- Created FLY.md with detailed deployment documentation and prerequisites
### Impact
- Changes PostgreSQL version from 17 to 16 for compatibility with Fly.io
- Introduces deployment pathway for Fly.io platform users
- Requires Docker Hub account for image distribution
- No direct performance implications, but enables cloud deployment capabilities
inline patch 1: Dockerfile, Dockerfile-fly, FLY.md (+62/-2 lines) download inline-1.patch
diff --git a/Dockerfile b/Dockerfile
index 936440928..50b8ecd7d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
-ARG PG_MAJOR=17
-FROM postgres:$PG_MAJOR
+ARG PG_MAJOR=16
+FROM flyio/postgres-flex:$PG_MAJOR
ARG PG_MAJOR
COPY . /tmp/pgvector
diff --git a/Dockerfile-fly b/Dockerfile-fly
new file mode 100644
index 000000000..46ee0924a
--- /dev/null
+++ b/Dockerfile-fly
@@ -0,0 +1,20 @@
+ARG PG_MAJOR=16
+FROM flyio/postgres-flex:16
+ARG PG_MAJOR
+
+COPY . /tmp/pgvector
+
+RUN apt-get update && \
+ apt-mark hold locales && \
+ apt-get install -y --no-install-recommends build-essential postgresql-server-dev-$PG_MAJOR && \
+ cd /tmp/pgvector && \
+ make clean && \
+ make OPTFLAGS="" && \
+ make install && \
+ mkdir /usr/share/doc/pgvector && \
+ cp LICENSE README.md /usr/share/doc/pgvector && \
+ rm -r /tmp/pgvector && \
+ apt-get remove -y build-essential postgresql-server-dev-$PG_MAJOR && \
+ apt-get autoremove -y && \
+ apt-mark unhold locales && \
+ rm -rf /var/lib/apt/lists/*
diff --git a/FLY.md b/FLY.md
new file mode 100644
index 000000000..d9b3cad16
--- /dev/null
+++ b/FLY.md
@@ -0,0 +1,40 @@
+# Deploying PostgreSQL with pgvector on Fly.io
+
+Vector databases have become essential tools for AI and Machine Learning applications, particularly for similarity searches and embeddings storage. While Fly.io offers a standard PostgreSQL image, it doesn't include the popular `pgvector` extension by default. This guide explains how to deploy a PostgreSQL instance with `pgvector` on Fly.io.
+
+## Prerequisites
+- Docker installed on your local machine
+- Fly.io account and CLI installed
+- Docker Hub account
+
+## Steps to Deploy
+
+### 1. Build and Push the Custom Docker Image
+Build the custom PostgreSQL image with pgvector support:
+```shell
+docker build -f Dockerfile-fly -t <DOCKER_HUB_ACCOUNT>/fly-pgvector . --platform "linux/amd64"
+docker push <DOCKER_HUB_ACCOUNT>/fly-pgvector
+```
+Replace `<DOCKER_HUB_ACCOUNT>` with your Docker Hub username.
+
+### 2. Create PostgreSQL Cluster
+Deploy the custom PostgreSQL instance on Fly.io:
+```shell
+fly pg create --image-ref <DOCKER_HUB_ACCOUNT>/fly-pgvector --app <APP_NAME>
+```
+Replace `<APP_NAME>` with your desired application name.
+
+### 3. Enable External Access (Optional)
+To access the database from outside Fly.io's network:
+```shell
+fly ips allocate-v4 --app <APP_NAME>
+```
+
+This will assign a public IPv4 address to your database instance.
+
+## Next Steps
+- Configure your application to connect to the database
+- Create tables with vector columns
+- Enable the pgvector extension in your database
+
+For more information about pgvector usage, refer to the [official documentation](https://github.com/pgvector/pgvector).
\ No newline at end of file
^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] PR #739: Adds docker image based on fly io pgsql image
@ 2024-12-26 19:02 "farmisen (@farmisen)" <noreply+farmisen@github.com>
1 sibling, 0 replies; 3+ messages in thread
From: farmisen (@farmisen) @ 2024-12-26 19:02 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
wrong upstream - sry
^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] PR #739: Adds docker image based on fly io pgsql image
@ 2024-12-26 19:02 "farmisen (@farmisen)" <noreply+farmisen@github.com>
1 sibling, 0 replies; 3+ messages in thread
From: farmisen (@farmisen) @ 2024-12-26 19:02 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@farmisen closed this.
^ permalink raw [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-12-26 19:02 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-12-26 19:00 [pgvector/pgvector] PR #739: Adds docker image based on fly io pgsql image "farmisen (@farmisen)" <noreply+farmisen@github.com>
2024-12-26 19:02 ` "farmisen (@farmisen)" <noreply+farmisen@github.com>
2024-12-26 19:02 ` "farmisen (@farmisen)" <noreply+farmisen@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox