From 9aaba9f4f1897eb6f7a76fc90e35e5e8be26a6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Sat, 9 Apr 2022 01:32:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BA=86flarum?= =?UTF-8?q?=E7=9A=84=E5=9F=BA=E7=A1=80=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 25 +++++++++++++++++++++++++ Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c6a1a25 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,25 @@ +kind: pipeline +type: docker +name: flarum + +clone: + depth: 1 + +steps: + - name: ci-base + pull: if-not-exists + image: plugins/docker + settings: + username: robot$library+drone + password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR + repo: stark.doylee.cn/library/flarum + cache_from: + - "stark.doylee.cn/library/flarum" + target: base + tags: + - ${DRONE_BUILD_NUMBER} + - latest + registry: stark.doylee.cn + mirror: https://p2t7g3ky.mirror.aliyuncs.com + when: + event: push diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5d41362 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM php:apache as latest-apache + +# 系统基础配置 +USER root +WORKDIR /var/www + +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 + +RUN sed -i 's/\(security\|deb\).debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ + && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ + && apt update \ + && apt dist-upgrade -y \ + && apt autoremove -y \ + && apt autoclean -y + +# apache 基本配置 +RUN sed -ri -e 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/*.conf \ + && echo 'ServerName localhost' >> /etc/apache2/apache2.conf \ + && chown -R www-data:www-data /var/www \ + && a2enmod rewrite + +# gd pdo_mysql zip +RUN apt install -y \ + libzip-dev \ + zip \ + unzip \ + libpng-dev \ + zlib1g-dev \ + && docker-php-ext-configure gd \ + && docker-php-ext-install -j$(nproc) gd \ + && docker-php-ext-install pdo_mysql \ + && docker-php-ext-install zip \ + && docker-php-source delete \ + && rm -rf /var/lib/apt/lists/* + +# php 环境配置 +COPY --from=composer /usr/bin/composer /usr/bin/composer \ No newline at end of file