Skip to content

Commit

Permalink
feat: restructure repo for latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Jun 21, 2024
1 parent ee4a2a6 commit 2ba7b33
Show file tree
Hide file tree
Showing 28 changed files with 282 additions and 165 deletions.
44 changes: 43 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,47 @@
"extends": [
"github>dockhippie/.github//renovate/preset"
],
"packageRules": []
"packageRules": [
{
"description": "Update golang docker images",
"datasources": [
"docker"
],
"updateTypes": [
"major",
"minor"
],
"enabled": true,
"automerge": true
},
{
"description": "Update tags without merge",
"datasources": [
"github-releases"
],
"updateTypes": [
"major",
"minor"
],
"enabled": false,
"automerge": false,
"matchPackageNames": [
"matomo-org/matomo"
]
},
{
"description": "Update tags without merge",
"datasources": [
"github-releases"
],
"updateTypes": [
"patch"
],
"enabled": true,
"automerge": true,
"matchPackageNames": [
"matomo-org/matomo"
]
}
]
}
3 changes: 2 additions & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
repository:
name: piwik
description: Docker images for Piwik
description: Docker images for piwik
topics: docker, image

private: false
Expand Down
50 changes: 26 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
# Piwik
# piwik

[![Build Status](https://cloud.drone.io/api/badges/dockhippie/piwik/status.svg)](https://cloud.drone.io/dockhippie/piwik)
[![](https://images.microbadger.com/badges/image/webhippie/piwik.svg)](https://microbadger.com/images/webhippie/piwik "Get your own image badge on microbadger.com")

These are docker images for [Piwik](https://piwik.org/) running on an [PHP Caddy container](https://registry.hub.docker.com/u/webhippie/php-caddy/).
[![Docker Build](https://github.com/dockhippie/piwik/actions/workflows/docker.yml/badge.svg)](https://github.com/dockhippie/piwik/actions/workflows/docker.yml) [![GitHub Repo](https://img.shields.io/badge/github-repo-yellowgreen)](https://github.com/dockhippie/piwik)

These are docker images for [Piwik/Matomo][upstream] running on our
[Apache PHP image][parent].

## Versions

* [latest](./latest) available as `webhippie/piwik:latest`

For the available versions please look at [Docker Hub][dockerhub] or
[Quay][quayio] or check the existing folders within the
[GitHub repository][github].

## Volumes

* /var/lib/piwik
* /srv/www/vendor

* /var/lib/piwik

## Ports

* 8080

* 8080

## Available environment variables

```bash

```console
PIWIK_ARCHIVE_DIR = ${PIWIK_BASE_DIR}/archive
PIWIK_BASE_DIR = /var/lib/piwik
PIWIK_CONFIG_DIR = ${PIWIK_BASE_DIR}/config
PIWIK_PLUGINS_DIR = ${PIWIK_BASE_DIR}/plugins
PIWIK_SKIP_CHOWN = false
```


## Inherited environment variables

* [webhippie/php-caddy](https://github.com/dockhippie/php-caddy#available-environment-variables)
* [webhippie/caddy](https://github.com/dockhippie/caddy#available-environment-variables)
* [webhippie/alpine](https://github.com/dockhippie/alpine#available-environment-variables)

* [webhippie/php-apache](https://github.com/dockhippie/php-apache#available-environment-variables)
* [webhippie/apache](https://github.com/dockhippie/apache#available-environment-variables)
* [webhippie/alpine](https://github.com/dockhippie/alpine#available-environment-variables)

## Contributing

Fork -> Patch -> Push -> Pull Request


## Authors

* [Thomas Boerger](https://github.com/tboerger)

* [Thomas Boerger](https://github.com/tboerger)

## License

MIT


## Copyright

```
```console
Copyright (c) 2015 Thomas Boerger <http://www.webhippie.de>
```

[upstream]: https://matomo.org/
[parent]: https://github.com/dockhippie/php-apache
[dockerhub]: https://hub.docker.com/r/webhippie/piwik/tags
[quayio]: https://quay.io/repository/webhippie/piwik?tab=tags
[github]: https://github.com/dockhippie/piwik
36 changes: 20 additions & 16 deletions latest/Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
FROM webhippie/php-caddy:latest-amd64

LABEL maintainer="Thomas Boerger <[email protected]>" \
org.label-schema.name="Piwik" \
org.label-schema.version="latest" \
org.label-schema.vendor="Thomas Boerger" \
org.label-schema.schema-version="1.0"
FROM ghcr.io/dockhippie/php-apache:8.3-amd64

VOLUME ["/var/lib/piwik"]
EXPOSE 8080

WORKDIR /srv/www
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]

ENV CRON_ENABLED true
CMD ["/usr/bin/container"]

RUN apk update && \
apk upgrade && \
apk add php7-ldap && \
rm -rf /var/cache/apk/* && \
curl -sLo - http://builds.piwik.org/piwik-3.13.3.tar.gz | tar -xzf - --strip 1 -C /srv/www && \
chown -R caddy:caddy /srv/www
apk add php${PHP_PACKAGE_VERSION}-ldap sqlite git && \
rm -rf /var/cache/apk/*

ENV PHP_COMPOSER_INSTALL=false

# renovate: datasource=github-releases depName=kanboard/kanboard
ENV MATOMO_VERSION=5.1.0

# renovate: datasource=github-releases depName=aptible/supercronic
ENV SUPERCRONIC_VERSION=0.2.30

RUN curl -sSLo - http://builds.matomo.org/matomo-${MATOMO_VERSION}.tar.gz | tar -xzf - --strip 1 -C /srv/www && \
cd /srv/www && \
chown -R apache:apache /srv/www && \
curl -sSLo /usr/bin/supercronic https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-amd64 && \
chmod +x /usr/bin/supercronic

COPY ./overlay ./overlay-amd64 /
COPY ./overlay /
28 changes: 28 additions & 0 deletions latest/Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ghcr.io/dockhippie/php-apache:8.3-arm

VOLUME ["/var/lib/piwik"]
EXPOSE 8080

WORKDIR /srv/www
CMD ["/usr/bin/container"]

RUN apk update && \
apk upgrade && \
apk add php${PHP_PACKAGE_VERSION}-ldap sqlite git && \
rm -rf /var/cache/apk/*

ENV PHP_COMPOSER_INSTALL=false

# renovate: datasource=github-releases depName=kanboard/kanboard
ENV MATOMO_VERSION=5.1.0

# renovate: datasource=github-releases depName=aptible/supercronic
ENV SUPERCRONIC_VERSION=0.2.30

RUN curl -sSLo - http://builds.matomo.org/matomo-${MATOMO_VERSION}.tar.gz | tar -xzf - --strip 1 -C /srv/www && \
cd /srv/www && \
chown -R apache:apache /srv/www && \
curl -sSLo /usr/bin/supercronic https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-amd64 && \
chmod +x /usr/bin/supercronic

COPY ./overlay /
24 changes: 0 additions & 24 deletions latest/Dockerfile.arm32v6

This file was deleted.

28 changes: 28 additions & 0 deletions latest/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ghcr.io/dockhippie/php-apache:8.3-arm64

VOLUME ["/var/lib/piwik"]
EXPOSE 8080

WORKDIR /srv/www
CMD ["/usr/bin/container"]

RUN apk update && \
apk upgrade && \
apk add php${PHP_PACKAGE_VERSION}-ldap sqlite git && \
rm -rf /var/cache/apk/*

ENV PHP_COMPOSER_INSTALL=false

# renovate: datasource=github-releases depName=kanboard/kanboard
ENV MATOMO_VERSION=5.1.0

# renovate: datasource=github-releases depName=aptible/supercronic
ENV SUPERCRONIC_VERSION=0.2.30

RUN curl -sSLo - http://builds.matomo.org/matomo-${MATOMO_VERSION}.tar.gz | tar -xzf - --strip 1 -C /srv/www && \
cd /srv/www && \
chown -R apache:apache /srv/www && \
curl -sSLo /usr/bin/supercronic https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-amd64 && \
chmod +x /usr/bin/supercronic

COPY ./overlay /
24 changes: 0 additions & 24 deletions latest/Dockerfile.arm64v8

This file was deleted.

19 changes: 0 additions & 19 deletions latest/manifest.tmpl

This file was deleted.

Empty file removed latest/overlay-amd64/.keep
Empty file.
Empty file removed latest/overlay-arm32v6/.keep
Empty file.
Empty file removed latest/overlay-arm64v8/.keep
Empty file.
10 changes: 10 additions & 0 deletions latest/overlay/etc/container.d/25-dirs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

echo "> creating app dirs"
mkdir -p \
${PIWIK_BASE_DIR} \
${PIWIK_ARCHIVE_DIR} \
${PIWIK_PLUGINS_DIR} \
${PIWIK_CONFIG_DIR}

true
18 changes: 18 additions & 0 deletions latest/overlay/etc/container.d/30-copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

if [[ -d ${APACHE_WEBROOT}/plugins ]]; then
for PLUGIN in $(find ${APACHE_WEBROOT}/plugins -type d -maxdepth 1 -mindepth 1); do
NAME=$(basename ${PLUGIN})

echo "> copying ${NAME} plugin"
rm -rf /var/lib/piwik/plugins/${NAME}
cp -rf ${APACHE_WEBROOT}/plugins/${NAME} /var/lib/piwik/plugins/
done
fi

echo "> copying app config"
cp -rf \
${APACHE_WEBROOT}/config/* \
/var/lib/piwik/config/

true
21 changes: 21 additions & 0 deletions latest/overlay/etc/container.d/35-link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

echo "> symlink app plugins"
rm -rf ${APACHE_WEBROOT}/plugins
ln -sf \
/var/lib/piwik/plugins \
${APACHE_WEBROOT}/plugins

echo "> symlink app config"
rm -rf ${APACHE_WEBROOT}/config
ln -sf \
/var/lib/piwik/config \
${APACHE_WEBROOT}/config

echo "> symlink app archive"
rm -rf ${APACHE_WEBROOT}/archive
ln -sf \
/var/lib/piwik/archive \
${APACHE_WEBROOT}/archive

true
23 changes: 23 additions & 0 deletions latest/overlay/etc/container.d/40-chown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

if [[ "${KANBOARD_SKIP_CHOWN}" != "true" ]]; then
echo "> chown base dir"
find ${PIWIK_BASE_DIR} \( \! -user apache -o \! -group apache \) -print0 | xargs -0 -r chown apache:apache

if [[ ! ${PIWIK_BASE_DIR} =~ ^${PIWIK_ARCHIVE_DIR} ]]; then
echo "> chown archive dir"
find ${PIWIK_ARCHIVE_DIR} \( \! -user apache -o \! -group apache \) -print0 | xargs -r -0 chown apache:apache
fi

if [[ ! ${PIWIK_BASE_DIR} =~ ^${PIWIK_PLUGINS_DIR} ]]; then
echo "> chown plugins dir"
find ${PIWIK_PLUGINS_DIR} \( \! -user apache -o \! -group apache \) -print0 | xargs -r -0 chown apache:apache
fi

if [[ ! ${PIWIK_BASE_DIR} =~ ^${PIWIK_CONFIG_DIR} ]]; then
echo "> chown config dir"
find ${PIWIK_CONFIG_DIR} \( \! -user apache -o \! -group apache \) -print0 | xargs -r -0 chown apache:apache
fi
fi

true
File renamed without changes.
Loading

0 comments on commit 2ba7b33

Please sign in to comment.