Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/extra db support #20

Merged
merged 3 commits into from
Feb 24, 2024
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
62 changes: 62 additions & 0 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docker Image PostgreSQL
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *" # 6 AM Daily
push:
paths:
- postgres/**
- .github/workflows/postgres.yml

jobs:
postgres:
name: PostgreSQL
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
version:
- "16"
- "15"
- "14"
- "13"
- "12"

steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2

- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ !env.ACT }}

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ !env.ACT }}

- name: Set build-args
run: |-
ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')"
POSTGRES_VERSION=$(
docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls postgres \
| egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(-alpine)?\$" | sort -Vr | head -n1
)
echo "POSTGRES_VERSION=${POSTGRES_VERSION}" | tee /dev/stderr >> $GITHUB_ENV

- uses: docker/build-push-action@v3
with:
context: postgres
platforms: linux/amd64,linux/arm64
build-args: POSTGRES_VERSION=${{ env.POSTGRES_VERSION }}
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }}
tags: ghcr.io/${{ github.repository_owner }}/postgres:${{ matrix.version }},wardenenv/postgres:${{matrix.version}}

2 changes: 1 addition & 1 deletion php/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM quay.io/centos/centos:stream9

ARG PHP_VERSION
ARG PHP_EXTENSIONS="bcmath cli common gd gmp intl json mbstring \
mcrypt sodium mysqlnd opcache pdo pecl-msgpack pecl-amqp pecl-redis pecl-imagick pecl-zip process soap xml xmlrpc"
mcrypt sodium mysqlnd pgsql opcache pdo pdo_pgdql pecl-msgpack pecl-amqp pecl-redis pecl-imagick pecl-zip process soap xml xmlrpc"

RUN dnf update -y \
&& dnf clean all \
Expand Down
5 changes: 5 additions & 0 deletions postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG POSTGRES_VERSION
FROM pgsql:${POSTGRES_VERSION}

COPY docker-entrypoint-initdb.d/uuid-ossp-extension.sql /docker-entrypoint-init.d/uuid-ossp-extension.sql

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION "uuid-ossp";