Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ~ build

on:
workflow_call:
inputs:
tag:
type: string
required: true

jobs:
builder:
name: builder image
runs-on: ubuntu-22.04
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 'Build Postgres Image'
run: |
docker build \
-f Dockerfile.postgres \
--platform linux/amd64 \
-t ghcr.io/trycompa/postgres:${{ inputs.tag }} .
docker push ghcr.io/trycompa/postgres:${{ inputs.tag }}
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: main

on:
push:
branches:
- main

jobs:
docker:
name: docker
uses: ./.github/workflows/_docker.yml
with:
tag: '14'
12 changes: 12 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: pr

on:
pull_request:
workflow_dispatch:

jobs:
docker:
name: docker
uses: ./.github/workflows/_docker.yml
with:
tag: 14-${{ github.sha }}
22 changes: 22 additions & 0 deletions Dockerfile.postgres
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Same major version as production
FROM imresamu/postgis:14-3.4
LABEL org.opencontainers.image.source="https://github.com/trycompa/docker-postgres"


# Install build dependencies and pgvector
RUN apt-get update && apt-get install -y \
build-essential \
git \
postgresql-server-dev-14 \
&& git clone --branch v0.5.1 https://github.com/pgvector/pgvector.git \
&& cd pgvector \
&& make \
&& make install \
&& cd .. \
&& rm -rf pgvector \
&& apt-get remove -y build-essential git postgresql-server-dev-14 \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

# log all queries
CMD ["postgres", "-c", "log_statement=all"]
Loading