init: 🎉 初始化了仓库和 7.4-caddy
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
李东云
2022-05-10 20:18:20 +08:00
commit 9479b2a5f9
4 changed files with 141 additions and 0 deletions

87
.drone.yml Normal file
View File

@@ -0,0 +1,87 @@
# ---
# kind: pipeline
# type: docker
# name: caddy
# clone:
# depth: 1
# steps:
# # 8.1
# - name: build
# pull: if-not-exists
# image: plugins/docker
# settings:
# username: robot$library+drone
# password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR
# repo: stark.doylee.cn/library/php
# cache_from:
# - "stark.doylee.cn/library/php"
# tags:
# - ${DRONE_BUILD_NUMBER}
# - 8.1-caddy
# - 8-caddy
# - caddy
# - latest
# target: caddy-latest
# registry: stark.doylee.cn
# mirror: https://p2t7g3ky.mirror.aliyuncs.com
# when:
# event: push
# ---
# kind: pipeline
# type: docker
# name: 7.3-caddy
# clone:
# depth: 1
# steps:
# # 7.3
# - name: build
# pull: if-not-exists
# image: plugins/docker
# settings:
# username: robot$library+drone
# password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR
# repo: stark.doylee.cn/library/php
# cache_from:
# - "stark.doylee.cn/library/php:7.3-caddy"
# tags:
# - ${DRONE_BUILD_NUMBER}
# - 7.3-caddy
# target: caddy-73
# registry: stark.doylee.cn
# mirror: https://p2t7g3ky.mirror.aliyuncs.com
# when:
# event: push
#
# ---
kind: pipeline
type: docker
name: php-caddy
clone:
depth: 1
steps:
# 7.4
- name: build
pull: if-not-exists
image: plugins/docker
settings:
username: robot$library+drone
password: DhmbcQyu7I5uaUfWbzcedbDGB0gfhuFR
repo: stark.doylee.cn/library/php
cache_from:
- "stark.doylee.cn/library/php:7-caddy"
tags:
- ${DRONE_BUILD_NUMBER}
- 7.4-caddy
- 7-caddy
registry: stark.doylee.cn
mirror: https://p2t7g3ky.mirror.aliyuncs.com
dockerfile: caddy/7.4/Dockerfile
when:
event: push

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# php

16
caddy/7.4/Caddyfile Normal file
View File

@@ -0,0 +1,16 @@
localhost
root * /app/public
# https://caddyserver.com/docs/caddyfile/directives/php_fastcgi
php_fastcgi localhost:9000 {
try_files {path} {path}/index.php =404
}
file_server
handle_errors {
root * /etc/caddy/error
rewrite * /error.html
templates
file_server
}

36
caddy/7.4/Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
FROM php:7-fpm-alpine
LABEL version="7.4" \
description="php-fpm7.4 alpine" \
maintainer="ch4o5<li_dongyun@outlook.com>"
# 系统设置(设置时区)
RUN rm -rf /etc/localtime \
&& ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" /etc/timezone
# 国内源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& RUN apk add --no-cache ca-certificates mailcap \
&& set -eux; \
&& mkdir -p \
/config/caddy \
/data/caddy \
/etc/caddy \
/usr/share/caddy
# 添加 Caddy
COPY --from=caddy /usr/bin/caddy /usr/bin/caddy
COPY Caddyfile /etc/caddy/
COPY --from=caddy /usr/share/caddy /usr/share/caddy
COPY --from=caddy /etc/nsswitch.conf /etc/nsswitch.conf
# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME /config
ENV XDG_DATA_HOME /data
EXPOSE 80
# 入口
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]