File tree Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,13 @@ jobs:
22
22
username : ${{ github.actor }}
23
23
password : ${{ secrets.GITHUB_TOKEN }}
24
24
25
+ - name : ' Set up Docker Buildx'
26
+ uses : docker/setup-buildx-action@v3
27
+
25
28
- name : ' Build Postgres Image'
26
29
run : |
27
- docker build \
30
+ docker buildx build \
28
31
-f Dockerfile.postgres \
29
- --platform linux/amd64 \
30
- -t ghcr.io/trycompa/postgres:${{ inputs.tag }} .
31
- docker push ghcr.io/trycompa/postgres:${{ inputs.tag }}
32
+ --platform linux/amd64,linux/arm64 \
33
+ -t ghcr.io/trycompa/postgres:${{ inputs.tag }} \
34
+ -- push .
Original file line number Diff line number Diff line change @@ -18,5 +18,8 @@ RUN apt-get update && apt-get install -y \
18
18
&& apt-get autoremove -y \
19
19
&& rm -rf /var/lib/apt/lists/*
20
20
21
+ RUN mkdir -p /docker-entrypoint-initdb.d
22
+ COPY ./initdb-vector.sh /docker-entrypoint-initdb.d/vector.sh
23
+
21
24
# log all queries
22
25
CMD ["postgres", "-c", "log_statement=all"]
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ # Perform all actions as $POSTGRES_USER
6
+ export PGUSER=" $POSTGRES_USER "
7
+
8
+ # Create the 'template_vector' template db
9
+ " ${psql[@]} " << - 'EOSQL '
10
+ CREATE DATABASE template_vector IS_TEMPLATE true;
11
+ EOSQL
12
+
13
+ # Load vector into both template_database and $POSTGRES_DB
14
+ for DB in template_postgis " $POSTGRES_DB " ; do
15
+ echo " Loading PostGIS extensions into $DB "
16
+ " ${psql[@]} " --dbname=" $DB " << -'EOSQL '
17
+ CREATE EXTENSION IF NOT EXISTS vector;
18
+ EOSQL
19
+ done
You can’t perform that action at this time.
0 commit comments