Skip to content

Commit a023a3b

Browse files
committed
first commit
0 parents  commit a023a3b

File tree

4 files changed

+110
-0
lines changed

4 files changed

+110
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build Docker Images
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch:
6+
env:
7+
REGISTRY: ghcr.io
8+
IMAGE_NAME: ${{ github.repository }}
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
max-parallel: 1
14+
fail-fast: false
15+
matrix:
16+
version: ["3.10-slim-bullseye"]
17+
variant: ["pgvector"]
18+
name: ${{ matrix.version }} ${{ matrix.variant }}
19+
permissions:
20+
contents: read
21+
packages: write
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
- name: Log into registry ${{ env.REGISTRY }}
27+
uses: docker/login-action@v2
28+
with:
29+
registry: ${{ env.REGISTRY }}
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v2
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@v4
38+
with:
39+
file: docker/${{ matrix.version }}-${{ matrix.variant }}.Dockerfile
40+
context: .
41+
push: true
42+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }}-${{ matrix.variant }}
43+
cache-from: type=gha,scope=$GITHUB_REF_NAME-${{ matrix.version }}-${{ matrix.variant }}
44+
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-${{ matrix.version }}-${{ matrix.variant }}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Mehdi Abedi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM pgvector/pgvector:pg17
2+
3+
# Install Python 3.10 and supervisor
4+
RUN --mount=type=bind,source=fs,target=/mnt apt-get update && apt-get install -y \
5+
wget curl build-essential \
6+
zlib1g-dev libncurses5-dev libgdbm-dev \
7+
libnss3-dev libssl-dev libreadline-dev libffi-dev \
8+
libsqlite3-dev libbz2-dev \
9+
supervisor \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
# Install Python 3.10 from source
13+
RUN curl -O https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tgz && \
14+
tar -xf Python-3.10.13.tgz && \
15+
cd Python-3.10.13 && \
16+
./configure --enable-optimizations && \
17+
make -j $(nproc) && \
18+
make altinstall && \
19+
cd .. && rm -rf Python-3.10.13*
20+
21+
# Symlink python and pip
22+
RUN ln -s /usr/local/bin/python3.10 /usr/local/bin/python && \
23+
ln -s /usr/local/bin/pip3.10 /usr/local/bin/pip
24+
25+
# Start supervisord
26+
CMD ["/usr/bin/supervisord"]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[program:postgres]
5+
command=/usr/local/bin/docker-entrypoint.sh postgres
6+
autostart=true
7+
autorestart=true
8+
stderr_logfile=/var/log/supervisor/postgres.err.log
9+
stdout_logfile=/var/log/supervisor/postgres.out.log
10+
priority=5
11+
12+
[program:app]
13+
command=python main.py
14+
directory=/app
15+
autostart=true
16+
autorestart=true
17+
stderr_logfile=/var/log/supervisor/app.err.log
18+
stdout_logfile=/var/log/supervisor/app.out.log
19+
priority=10

0 commit comments

Comments
 (0)