diff --git a/Dockerfile b/config/Dockerfile similarity index 100% rename from Dockerfile rename to config/Dockerfile diff --git a/typecho/Caddyfile b/typecho/Caddyfile new file mode 100644 index 0000000..a8cf0bc --- /dev/null +++ b/typecho/Caddyfile @@ -0,0 +1,6 @@ +rlds.tk { + encode gzip + root * /www/websites/typecho + php_fastcgi php-fpm:9000 + file_server +} \ No newline at end of file diff --git a/typecho/Dockerfile b/typecho/Dockerfile new file mode 100644 index 0000000..56eb415 --- /dev/null +++ b/typecho/Dockerfile @@ -0,0 +1,54 @@ +FROM php:8.1.15-fpm-alpine3.17 + +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +COPY Caddyfile /etc/caddy/Caddyfile +ENV BUILD_DEPS \ + libzip-dev \ + icu-dev \ + postgresql-dev \ + libpng-dev \ + libwebp-dev \ + libjpeg-turbo-dev \ + curl-dev \ + sqlite-dev \ + oniguruma-dev \ + memcached-dev + +ENV RUN_DEPS \ + autoconf \ + libzip \ + icu \ + postgresql-libs \ + libpng \ + libwebp \ + libjpeg-turbo \ + curl \ + sqlite-libs \ + oniguruma \ + memcached + +ENV PHP_EXTENSIONS \ + zip \ + intl \ + exif \ + pdo_mysql \ + pdo_pgsql \ + mysqli \ + pgsql \ + gd \ + curl \ + session \ + pdo_sqlite \ + fileinfo \ + mbstring + +RUN set -eux && \ + sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \ + apk update && \ + apk add --no-cache $RUN_DEPS && \ + apk add --no-cache --virtual .build-deps $BUILD_DEPS && \ + docker-php-ext-configure gd --enable-gd --with-jpeg --with-webp && \ + docker-php-ext-install -j $(nproc) $PHP_EXTENSIONS && \ +# pecl install redis memcached && \ +# docker-php-ext-enable redis memcached && \ + apk del .build-deps \ No newline at end of file diff --git a/typecho/caddy/Caddyfile b/typecho/caddy/Caddyfile new file mode 100644 index 0000000..9584b52 --- /dev/null +++ b/typecho/caddy/Caddyfile @@ -0,0 +1,16 @@ +{ + auto_https disable_redirects + email admin@rainss.cc +} +rainss.net:80 { + encode gzip + root * /www/websites/typecho + php_fastcgi php-fpm:9000 + file_server +} +http://pay.test { + root * /www/websites/typecho + encode gzip + php_fastcgi php-fpm:9000 + file_server +} \ No newline at end of file diff --git a/typecho/docker-compose.yaml b/typecho/docker-compose.yaml new file mode 100644 index 0000000..6423bdd --- /dev/null +++ b/typecho/docker-compose.yaml @@ -0,0 +1,28 @@ +version: '3.2' +services: + webservice: + container_name: caddy + image: caddy:latest + ports: + - "80:80" + - "443:443" + - "443:443/udp" + volumes: + - ./caddy/Caddyfile:/etc/caddy/Caddyfile + - ./caddy/config:/config + - ./caddy/data:/data + - ./caddy/websites:/www/websites + depends_on: + - php-cgi + restart: unless-stopped + php-cgi: + container_name: php-fpm + build: + context: . + dockerfile: Dockerfile + volumes: + - ./caddy/websites:/www/websites +# - ./caddy/config/php:/usr/local/etc/php + restart: unless-stopped +networks: + website: