diff --git a/docker-compose.yml b/docker-compose.yml index fbd0c8a..9f9f747 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ version: '3' services: db: - image: postgres:12-alpine + image: cthulhoo/ttrss-db-pgsql-count-bits:latest restart: unless-stopped volumes: - db:/var/lib/postgresql/data diff --git a/src/db/Dockerfile b/src/db/Dockerfile new file mode 100644 index 0000000..9f5021a --- /dev/null +++ b/src/db/Dockerfile @@ -0,0 +1,15 @@ +FROM postgres:11 +EXPOSE 5432 + +RUN apt-get update +RUN apt-get -y install git libpq-dev postgresql-server-dev-11 +RUN apt-get -y install gcc make + +COPY init-count-bits.sh /docker-entrypoint-initdb.d/ + +RUN git clone https://github.com/sldab/count-bits.git /opt/count-bits && \ + cd /opt/count-bits && \ + make && \ + sed -i.bak 's/create_functions: install/create_functions:/' Makefile && \ + make install + diff --git a/src/db/init-count-bits.sh b/src/db/init-count-bits.sh new file mode 100755 index 0000000..c50759f --- /dev/null +++ b/src/db/init-count-bits.sh @@ -0,0 +1 @@ +cd /opt/count-bits && make create_functions diff --git a/src/docker-compose.yml b/src/docker-compose.yml index f5e52b9..8f3b70c 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -5,7 +5,10 @@ version: '3' services: db: - image: postgres:12-alpine + image: cthulhoo/ttrss-db-pgsql-count-bits:${BUILD_TAG} + build: + context: + ./db restart: unless-stopped volumes: - db:/var/lib/postgresql/data