Skip to content

Commit

Permalink
customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
GoliathLabs committed Oct 10, 2024
1 parent b6da87f commit 69822a8
Show file tree
Hide file tree
Showing 31 changed files with 145 additions and 1,154 deletions.
2 changes: 2 additions & 0 deletions .github/buildkitd.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[worker.oci]
max-parallelism = 4
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Docs: <https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/customizing-dependency-updates>

version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule: {interval: monthly}
reviewers: [freifunkMUC/salt-stack]
assignees: [freifunkMUC/salt-stack]

- package-ecosystem: docker
directory: /
schedule: {interval: monthly}
reviewers: [freifunkMUC/salt-stack]
assignees: [freifunkMUC/salt-stack]
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Docker image

on:
push:
branches:
- main
pull_request:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
with:
config: .github/buildkitd.toml
- name: Retrieve author data
run: |
echo AUTHOR=$(curl -sSL ${{ github.event.repository.owner.url }} | jq -r '.name') >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.authors=${{ env.AUTHOR }}
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.head_ref || github.ref_name }}
COMMIT=${{ github.sha }}
- name: Inspect Docker image
run: docker image inspect ${{ steps.meta.outputs.tags }}
24 changes: 0 additions & 24 deletions .github/workflows/package-nextcloud.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/package-phpldapadmin.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/package.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish Docker image
on:
push:
branches:
- master
tags:
- 'v*.*.*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config: .github/buildkitd.toml
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retrieve author data
run: |
echo AUTHOR=$(curl -sSL ${{ github.event.repository.owner.url }} | jq -r '.name') >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.authors=${{ env.AUTHOR }}
- name: Build container image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/ppc64le,linux/s390x
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.head_ref || github.ref_name }}
COMMIT=${{ github.sha }}
File renamed without changes.
24 changes: 17 additions & 7 deletions phpldapadmin/Containerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM alpine:3.19

# Argument for the app version
ARG APP_VERSION

# Install all required packages and configure Apache and PHP
RUN set -ex; \
apk add --no-cache \
apache2 \
Expand All @@ -18,26 +20,34 @@ RUN set -ex; \
php81-session \
php81-xml \
php81-pecl-apcu; \
rm -f /etc/apache2/conf.d/info.conf; \
rm -f /etc/apache2/conf.d/userdir.conf; \
ln -sf /usr/bin/php81 /usr/bin/php;
\
# Remove unnecessary Apache configuration files
rm -f /etc/apache2/conf.d/info.conf /etc/apache2/conf.d/userdir.conf; \
\
# Create symlink for PHP
ln -sf /usr/bin/php81 /usr/bin/php; \
\
# Enable the remoteip_module in Apache configuration
sed -i -e 's|^#\(LoadModule remoteip_module.*\)|\1|' /etc/apache2/httpd.conf

# Copy PHP and Apache configuration files
COPY php.conf.d/ /etc/php81/conf.d/
COPY apache2.conf.d/ /etc/apache2/conf.d/

RUN set -ex; \
sed -i -e 's|^#\(LoadModule remoteip_module.*\)|\1|' /etc/apache2/httpd.conf

# Download, extract, and install phpLDAPadmin
RUN set -ex; \
curl -fsSL -o "phpLDAPadmin-${APP_VERSION}.tar.gz" \
"https://github.com/leenooks/phpLDAPadmin/archive/${APP_VERSION}.tar.gz"; \
mkdir -p /var/www/phpldapadmin; \
tar -xzf "phpLDAPadmin-${APP_VERSION}.tar.gz" --strip-components=1 -C /var/www/phpldapadmin; \
rm "phpLDAPadmin-${APP_VERSION}.tar.gz";
rm "phpLDAPadmin-${APP_VERSION}.tar.gz"

# Copy the entrypoint script
COPY entrypoint.sh /

# Signal for proper container stop handling
STOPSIGNAL SIGWINCH

# Set the entrypoint script and Apache start command
ENTRYPOINT ["/entrypoint.sh"]
CMD ["httpd", "-DFOREGROUND"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion nextcloud/APP_VERSION

This file was deleted.

Loading

0 comments on commit 69822a8

Please sign in to comment.