Skip to content

Commit

Permalink
Merge pull request #4 from Andrew-Bekhiet/main
Browse files Browse the repository at this point in the history
feat: add timescale 2.17 with postgres 17
  • Loading branch information
brody192 authored Nov 28, 2024
2 parents 02f73c8 + 663ce77 commit ca869e8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ jobs:

strategy:
matrix:
dockerfile: ['Dockerfile.pg13-ts2.12', 'Dockerfile.pg14-ts2.12','Dockerfile.pg15-ts2.12','Dockerfile.pg16-ts2.13']
dockerfile:
[
"Dockerfile.pg13-ts2.12",
"Dockerfile.pg14-ts2.12",
"Dockerfile.pg15-ts2.12",
"Dockerfile.pg16-ts2.13",
"Dockerfile.pg17-ts2.17",
]

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -43,11 +50,10 @@ jobs:
echo "::set-output name=version::${version}"
shell: bash


- name: Build and Publish
uses: docker/build-push-action@v4
with:
file: ${{ matrix.dockerfile }}
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.extract_version.outputs.version }}
tags: ghcr.io/${{ github.repository }}:${{ steps.extract_version.outputs.version }}
23 changes: 23 additions & 0 deletions Dockerfile.pg17-ts2.17
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM timescale/timescaledb-ha:pg17-ts2.17

# Switch to root user for apt operations
USER root

# Install OpenSSL and sudo
RUN apt-get update && apt-get install -y openssl sudo

# Allow the postgres user to execute certain commands as root without a password
RUN echo "postgres ALL=(root) NOPASSWD: /usr/bin/mkdir, /bin/chown, /usr/bin/openssl" > /etc/sudoers.d/postgres

# Add init scripts while setting permissions
COPY --chmod=755 init-ssl.sh /docker-entrypoint-initdb.d/init-ssl.sh
COPY --chmod=755 wrapper.sh /usr/local/bin/wrapper.sh

# Switch back to the postgres
USER postgres

# Override the ENTRYPOINT with a wrapper script
ENTRYPOINT ["wrapper.sh"]

# Start postgres listening on port 5432
CMD ["postgres", "--port=5432"]

0 comments on commit ca869e8

Please sign in to comment.