refactor(7.4): 🦄 将 apache 改为了 caddy
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
李东云
2022-05-10 22:06:17 +08:00
parent e4874522c9
commit 5fa550aba3
2 changed files with 20 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
# --- # ---
# kind: pipeline # kind: pipeline
# type: docker # type: docker
# name: apache # name: caddy
# clone: # clone:
# depth: 1 # depth: 1
@@ -19,11 +19,11 @@
# - "stark.doylee.cn/library/flarum" # - "stark.doylee.cn/library/flarum"
# tags: # tags:
# - ${DRONE_BUILD_NUMBER} # - ${DRONE_BUILD_NUMBER}
# - 8.1-apache # - 8.1-caddy
# - 8-apache # - 8-caddy
# - apache # - caddy
# - latest # - latest
# target: apache-latest # target: caddy-latest
# registry: stark.doylee.cn # registry: stark.doylee.cn
# mirror: https://p2t7g3ky.mirror.aliyuncs.com # mirror: https://p2t7g3ky.mirror.aliyuncs.com
# when: # when:
@@ -32,7 +32,7 @@
# --- # ---
# kind: pipeline # kind: pipeline
# type: docker # type: docker
# name: 7.3-apache # name: 7.3-caddy
# clone: # clone:
# depth: 1 # depth: 1
@@ -47,11 +47,11 @@
# password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR # password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR
# repo: stark.doylee.cn/library/flarum # repo: stark.doylee.cn/library/flarum
# cache_from: # cache_from:
# - "stark.doylee.cn/library/flarum:7.3-apache" # - "stark.doylee.cn/library/flarum:7.3-caddy"
# tags: # tags:
# - ${DRONE_BUILD_NUMBER} # - ${DRONE_BUILD_NUMBER}
# - 7.3-apache # - 7.3-caddy
# target: apache-73 # target: caddy-73
# registry: stark.doylee.cn # registry: stark.doylee.cn
# mirror: https://p2t7g3ky.mirror.aliyuncs.com # mirror: https://p2t7g3ky.mirror.aliyuncs.com
# when: # when:
@@ -60,7 +60,7 @@
# --- # ---
kind: pipeline kind: pipeline
type: docker type: docker
name: 7-apache name: 7-caddy
clone: clone:
depth: 1 depth: 1
@@ -75,11 +75,11 @@ steps:
password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR
repo: stark.doylee.cn/library/flarum repo: stark.doylee.cn/library/flarum
cache_from: cache_from:
- "stark.doylee.cn/library/flarum:7-apache" - "stark.doylee.cn/library/flarum:7-caddy"
tags: tags:
- ${DRONE_BUILD_NUMBER} - ${DRONE_BUILD_NUMBER}
- 7.4-apache - 7.4-caddy
- 7-apache - 7-caddy
registry: stark.doylee.cn registry: stark.doylee.cn
mirror: https://p2t7g3ky.mirror.aliyuncs.com mirror: https://p2t7g3ky.mirror.aliyuncs.com
dockerfile: 7.4/Dockerfile dockerfile: 7.4/Dockerfile

View File

@@ -1,39 +1,16 @@
FROM php:7-apache FROM stark.doylee.cn/library/php:7-caddy
# 系统基础配置
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 # gd pdo_mysql zip
RUN apt install -y \ RUN apk add --no-cache \
libzip-dev \ libzip-dev \
zip \ # zip \
unzip \ # unzip \
libpng-dev \ libpng-dev \
zlib1g-dev \ # zlib1g-dev \
libgmp-dev \ # libgmp-dev \
&& docker-php-ext-configure gd \ && docker-php-ext-configure gd \
&& docker-php-ext-install -j$(nproc) gd \ && docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install pdo_mysql \ && docker-php-ext-install pdo_mysql \
&& docker-php-ext-install zip \ && docker-php-ext-install zip \
&& docker-php-source delete \ && docker-php-source delete \
&& rm -rf /var/lib/apt/lists/* && chown -R www-data:www-data /srv
# php 环境配置
COPY --from=composer /usr/bin/composer /usr/bin/composer