diff --git a/.gitea/workflows/container.yaml b/.gitea/workflows/container.yaml deleted file mode 100644 index e48b3fd..0000000 --- a/.gitea/workflows/container.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: Build Multiarch Container Image -on: [push] -jobs: - call-reusable-workflow: - uses: container/multiarch-build-workflow/.gitea/workflows/build.yaml@main - with: - repository: ${{ gitea.repository }} - ref_name: ${{ gitea.ref_name }} - sha: ${{ gitea.sha }} - registry_url: ${{ secrets.REGISTRY_URL }} - registry_user: ${{ secrets.REGISTRY_USER }} - registry_pw: ${{ secrets.REGISTRY_PW }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f5f21ec --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +variables: + CONTAINER_NAME: thallian/roundcube + +build: + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --context "$CI_PROJECT_DIR" + --dockerfile "$CI_PROJECT_DIR/Dockerfile" + --destination "$CONTAINER_NAME:$CI_COMMIT_SHA" + --destination "$CONTAINER_NAME:$CI_COMMIT_REF_NAME" + --destination "$CONTAINER_NAME:latest" diff --git a/Containerfile b/Containerfile deleted file mode 100644 index 7b3c1c7..0000000 --- a/Containerfile +++ /dev/null @@ -1,74 +0,0 @@ -FROM docker.io/alpine:3.19 AS builder - -RUN apk add --no-cache \ - php83 \ - php83-phar \ - php83-mbstring \ - php83-openssl \ - php83-ctype \ - php83-gd \ - php83-dom \ - php83-xml \ - php83-ldap \ - php83-xmlreader \ - php83-xmlwriter - -ENV COMPOSER_VERSION=2.6.6 -ENV COMPOSER_SHA256_SUM=72600201c73c7c4b218f1c0511b36d8537963e36aafa244757f52309f885b314 -RUN wget https://getcomposer.org/download/$COMPOSER_VERSION/composer.phar -RUN echo "$COMPOSER_SHA256_SUM composer.phar" | sha256sum -c - || exit 1 -RUN mv composer.phar /usr/bin/composer -RUN chmod +x /usr/bin/composer - -ENV VERSION=1.6.6 -ENV SHA256_SUM=c1b93a3edbe297457396b0a031d8b13c8a5dc30c9370704dfb9b2c1225017d52 -RUN wget https://github.com/roundcube/roundcubemail/releases/download/$VERSION/roundcubemail-$VERSION-complete.tar.gz -RUN echo "$SHA256_SUM roundcubemail-$VERSION-complete.tar.gz" | sha256sum -c - || exit 1 -RUN mkdir -p /var/lib/roundcube -RUN tar xzf roundcubemail-$VERSION-complete.tar.gz -C /var/lib/roundcube --strip 1 - -FROM docker.io/thallian/php8-fpm:3.19-8.3 - -RUN apk add --no-cache \ - openssl \ - tar \ - nginx \ - postgresql-client \ - aspell \ - ca-certificates \ - php83 \ - php83-imap \ - php83-dom \ - php83-json \ - php83-xml \ - php83-session \ - php83-pdo \ - php83-pdo_pgsql \ - php83-sockets \ - php83-exif \ - php83-iconv \ - php83-openssl \ - php83-mbstring \ - php83-sockets \ - php83-zip \ - php83-pspell \ - php83-pecl-apcu \ - php83-gd \ - php83-ctype \ - php83-xmlreader \ - php83-xmlwriter \ - php83-tokenizer \ - php83-curl \ - php83-simplexml \ - php83-xml \ - php83-dom \ - php83-intl - -COPY --from=builder --chown=nginx:nginx /var/lib/roundcube /var/lib/roundcube - -ADD /rootfs / - -EXPOSE 8080 - -ENV FPMUSER nginx -ENV FPMGROUP nginx diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d095bd0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,75 @@ +FROM docker.io/alpine:3.16 AS builder + +RUN apk add --no-cache \ + php8 \ + php8-phar \ + php8-mbstring \ + php8-openssl \ + php8-ctype \ + php8-gd \ + php8-dom \ + php8-xml \ + php8-ldap \ + php8-xmlreader \ + php8-xmlwriter + +ENV COMPOSER_VERSION=2.1.6 +ENV COMPOSER_SHA256_SUM=72524ccebcb071968eb83284507225fdba59f223719b2b3f333d76c8a9ac6b72 +RUN wget https://getcomposer.org/download/$COMPOSER_VERSION/composer.phar +RUN echo "$COMPOSER_SHA256_SUM composer.phar" | sha256sum -c - || exit 1 +RUN mv composer.phar /usr/bin/composer +RUN chmod +x /usr/bin/composer + +ENV VERSION=1.6.0 +ENV SHA256_SUM=2409ccdfe2e465f086cb9fc18c88dfe0aaf6ccc23924564975061209921694ba +RUN wget https://github.com/roundcube/roundcubemail/releases/download/$VERSION/roundcubemail-$VERSION-complete.tar.gz +RUN echo "$SHA256_SUM roundcubemail-$VERSION-complete.tar.gz" | sha256sum -c - || exit 1 +RUN mkdir -p /var/lib/roundcube +RUN tar xzf roundcubemail-$VERSION-complete.tar.gz -C /var/lib/roundcube --strip 1 + +FROM docker.io/thallian/php8-fpm:3.16 + +RUN apk add --no-cache \ + openssl \ + tar \ + nginx \ + postgresql-client \ + aspell \ + ca-certificates \ + php8 \ + php8-imap \ + php8-dom \ + php8-json \ + php8-xml \ + php8-session \ + php8-pdo \ + php8-pdo_pgsql \ + php8-sockets \ + php8-exif \ + php8-iconv \ + php8-openssl \ + php8-mbstring \ + php8-sockets \ + php8-pecl-mcrypt \ + php8-zip \ + php8-pspell \ + php8-pecl-apcu \ + php8-gd \ + php8-ctype \ + php8-xmlreader \ + php8-xmlwriter \ + php8-tokenizer \ + php8-curl \ + php8-simplexml \ + php8-xml \ + php8-dom \ + php8-intl + +COPY --from=builder --chown=nginx:nginx /var/lib/roundcube /var/lib/roundcube + +ADD /rootfs / + +EXPOSE 8080 + +ENV FPMUSER nginx +ENV FPMGROUP nginx diff --git a/rootfs/etc/confd/templates/config.inc.php.tmpl b/rootfs/etc/confd/templates/config.inc.php.tmpl index 27d3c5e..1a46fac 100644 --- a/rootfs/etc/confd/templates/config.inc.php.tmpl +++ b/rootfs/etc/confd/templates/config.inc.php.tmpl @@ -15,8 +15,6 @@ $config['imap_conn_options'] = array( ), ); -$config['request_path'] = 'SCRIPT_NAME'; - $config['smtp_host'] = '{{getenv "SMTP_HOST" "tls://%n"}}:{{getenv "SMTP_PORT" "587"}}'; $config['smtp_user'] = '%u'; $config['smtp_pass'] = '%p'; @@ -36,7 +34,7 @@ $config['username_domain'] = '%d'; $config['username_domain_forced'] = true; $config['password_charset'] = 'UTF-8'; -$config['plugins'] = array('archive', 'zipdownload'); +$config['plugins'] = array('archive', 'managesieve', 'zipdownload'); $config['spellcheck_engine'] = 'pspell'; $config['default_charset'] = 'UTF-8'; diff --git a/rootfs/etc/confd/templates/nginx.conf.tmpl b/rootfs/etc/confd/templates/nginx.conf.tmpl index c10328b..69289ed 100644 --- a/rootfs/etc/confd/templates/nginx.conf.tmpl +++ b/rootfs/etc/confd/templates/nginx.conf.tmpl @@ -22,7 +22,6 @@ http { {{range $domain := split (getenv "DOMAINS") ";"}} server { - listen [::]:8080; listen 8080; server_name {{ $domain }};