From 57d206ccbfa55cf3b120dca731f91efd980ce74d Mon Sep 17 00:00:00 2001 From: root Date: Fri, 3 Nov 2017 19:28:35 +0000 Subject: [PATCH] add cachethq into new repo --- .gitignore | 1 + Dockerfile | 36 +++++++++++++++++++++ builder.sh | 28 ++++++++++++++++ rootfs/cachetHQ/env | 45 ++++++++++++++++++++++++++ rootfs/nginx/sites-enabled/cachet.conf | 17 ++++++++++ rootfs/usr/local/bin/startup | 16 +++++++++ 6 files changed, 143 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100755 builder.sh create mode 100644 rootfs/cachetHQ/env create mode 100644 rootfs/nginx/sites-enabled/cachet.conf create mode 100644 rootfs/usr/local/bin/startup diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a871af --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +rootfs/cachetHQ/.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..942d820 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM xataz/nginx-php + +ENV UID=991 GID=991 + + +RUN export BUILD_DEPS="build-base \ + wget \ + gnupg \ + autoconf \ + libressl-dev \ + g++ \ + pcre-dev \ + curl-dev \ + libedit-dev \ + gcc \ + zlib-dev \ + make \ + pkgconf \ + wget \ + ca-certificates \ + libxml2-dev" \ + && apk -U add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS \ + && apk -U add ${BUILD_DEPS} \ + && pecl install apcu \ + && docker-php-ext-enable apcu \ + && apk del .phpize-deps-configure ${BUILD_DEPS} \ + && apk -U add git curl mariadb-client \ + && git clone --branch v2.3.13 https://github.com/CachetHQ/Cachet.git /cachetHQ +COPY rootfs / +WORKDIR cachetHQ +RUN chmod +x /usr/local/bin/startup \ + && mv env .env \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && composer install --no-dev \ + && apk del git curl \ + && rm -rf /var/cache/apk/* /tmp/* /root/.gnupg /root/.cache/ /cachetHQ/.git diff --git a/builder.sh b/builder.sh new file mode 100755 index 0000000..cad8753 --- /dev/null +++ b/builder.sh @@ -0,0 +1,28 @@ +docker build -t registry.dryusdan.fr/dryusdan/php:cachethq --build-arg PHP_EXT_LIST="gd \ + ctype \ + dom \ + iconv \ + json \ + xml \ + mbstring \ + posix \ + xmlwriter \ + zip \ + pdo_pgsql \ + pdo_mysql \ + curl \ + fileinfo \ + bz2 \ + intl \ + mcrypt \ + openssl \ + ldap \ + simplexml \ + pgsql \ + ftp \ + exif \ + gmp \ + mbstring / + apcu" https://github.com/xataz/docker-nginx-php.git +docker push registry.dryusdan.fr/dryusdan/php:cachethq +docker rmi registry.dryusdan.fr/dryusdan/php:cachethq diff --git a/rootfs/cachetHQ/env b/rootfs/cachetHQ/env new file mode 100644 index 0000000..83b7aa6 --- /dev/null +++ b/rootfs/cachetHQ/env @@ -0,0 +1,45 @@ +APP_ENV=production +APP_DEBUG=false +APP_URL=https://status.drycat.fr +APP_KEY= +APP_LOG=errorlog + +DB_DRIVER=mysql +DB_HOST=localhost +DB_DATABASE=cachet +DB_USERNAME=cachet +DB_PASSWORD= +DB_PORT=3306 +DB_PREFIX=cht_ + +DOCKER=true + +CACHE_DRIVER=apc + +SESSION_DRIVER=apc + +QUEUE_DRIVER=database + +CACHET_EMOJI=true +CACHET_BEACON=false +CACHET_AUTO_TWITTER=false + +MAIL_DRIVER=smtp +MAIL_HOST=mail.smtp.fr +MAIL_PORT=465 +MAIL_USERNAME= +MAIL_PASSWORD= +MAIL_ADDRESS= +MAIL_NAME="Status des services DryCat" +MAIL_ENCRYPTION=none + +REDIS_HOST=null +REDIS_DATABASE=null +REDIS_PORT=null +REDIS_PASSWORD=null + +GITHUB_TOKEN=null + +NEXMO_KEY=null +NEXMO_SECRET=null +NEXMO_SMS_FROM=null diff --git a/rootfs/nginx/sites-enabled/cachet.conf b/rootfs/nginx/sites-enabled/cachet.conf new file mode 100644 index 0000000..0d3158e --- /dev/null +++ b/rootfs/nginx/sites-enabled/cachet.conf @@ -0,0 +1,17 @@ +server { + listen 8080; + + root /cachetHQ/public; + index index.php; + + location / { + try_files $uri /index.php$is_args$args; + } + + location ~ \.php$ { + fastcgi_index index.php; + fastcgi_pass unix:/php/run/php-fpm.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include /nginx/conf/fastcgi_params; + } +} \ No newline at end of file diff --git a/rootfs/usr/local/bin/startup b/rootfs/usr/local/bin/startup new file mode 100644 index 0000000..1fe33b0 --- /dev/null +++ b/rootfs/usr/local/bin/startup @@ -0,0 +1,16 @@ +#!/bin/sh + +addgroup -g ${GID} web && adduser -H -s /bin/sh -D -G web -u ${UID} web + +mkdir -p /nginx /php + +php artisan app:install + +chown -R web:web /nginx /php /etc/s6.d /cachetHQ +chmod +x /etc/s6.d/*/run /etc/s6.d/.s6-svscan/finish + +if [ '$@' == '' ]; then + exec su-exec web:web /bin/s6-svscan /etc/s6.d +else + exec su-exec web:web "$@" +fi