Skip to content

Commit

Permalink
Docker QoL improvements
Browse files Browse the repository at this point in the history
- Create vector extension in the migration
- Ensure psql on the django docker image
- Use our maintenance scripts in the pg image
  while still using pgvector
  • Loading branch information
davidfischer committed Feb 8, 2024
1 parent 5b615ec commit 3ff59ba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions adserver/analyzer/migrations/0003_add_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunSQL('CREATE EXTENSION IF NOT EXISTS vector;'),
migrations.AddField(
model_name='analyzedurl',
name='embedding',
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ services:
tty: true

postgres:
# build:
# context: .
# dockerfile: ./docker-compose/postgres/Dockerfile
image: pgvector/pgvector:pg15
build:
context: .
dockerfile: ./docker-compose/postgres/Dockerfile
image: ethicaladserver_production_postgres
volumes:
- local_postgres_data:/var/lib/postgresql/data
- local_postgres_data_backups:/backups
Expand Down
1 change: 1 addition & 0 deletions docker-compose/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN apt-get -y install \
build-essential \
python3-pip \
python3-dev \
postgresql-client \
libmysqlclient-dev \
libfreetype6 \
libjpeg-dev \
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:15.2
FROM pgvector/pgvector:pg15

COPY ./docker-compose/postgres/maintenance /usr/local/bin/maintenance
RUN chmod +x /usr/local/bin/maintenance/*
Expand Down

0 comments on commit 3ff59ba

Please sign in to comment.