This commit is contained in:
commit
098f86087d
14
.drone.yml
Normal file
14
.drone.yml
Normal file
@ -0,0 +1,14 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: build docker image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: imbytecat/${DRONE_REPO_NAME}
|
||||
tags: latest
|
30
000-default.conf
Normal file
30
000-default.conf
Normal file
@ -0,0 +1,30 @@
|
||||
<VirtualHost *:80>
|
||||
# The ServerName directive sets the request scheme, hostname and port that
|
||||
# the server uses to identify itself. This is used when creating
|
||||
# redirection URLs. In the context of virtual hosts, the ServerName
|
||||
# specifies what hostname must appear in the request's Host: header to
|
||||
# match this virtual host. For the default virtual host (this file) this
|
||||
# value is not decisive as it is used as a last resort host regardless.
|
||||
# However, you must set it for any further virtual host explicitly.
|
||||
|
||||
ServerAdmin webmaster@localhost
|
||||
DocumentRoot /var/www/html/public
|
||||
|
||||
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
||||
# error, crit, alert, emerg.
|
||||
# It is also possible to configure the loglevel for particular
|
||||
# modules, e.g.
|
||||
#LogLevel info ssl:warn
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
|
||||
# For most configuration files from conf-available/, which are
|
||||
# enabled or disabled at a global level, it is possible to
|
||||
# include a line for only one particular virtual host. For example the
|
||||
# following line enables the CGI configuration for this host only
|
||||
# after it has been globally disabled with "a2disconf".
|
||||
#Include conf-available/serve-cgi-bin.conf
|
||||
</VirtualHost>
|
||||
|
||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
FROM php:7.4-apache
|
||||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
|
||||
# 可以运行 docker run --rm php:7.4-alpine php -m 查看预装的拓展
|
||||
RUN a2enmod rewrite && chmod +x /usr/local/bin/install-php-extensions && \
|
||||
install-php-extensions pdo_mysql opcache && \
|
||||
\
|
||||
{ \
|
||||
echo 'post_max_size = 100M;';\
|
||||
echo 'upload_max_filesize = 100M;';\
|
||||
echo 'max_execution_time = 600S;';\
|
||||
} > /usr/local/etc/php/conf.d/docker-php-upload.ini; \
|
||||
\
|
||||
{ \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
\
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
\
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
chmod -R g=u /var/www
|
||||
COPY ./000-default.conf /etc/apache2/sites-enabled/
|
||||
COPY entrypoint.sh /
|
||||
WORKDIR /var/www/html/
|
||||
VOLUME /var/www/html
|
||||
EXPOSE 80
|
||||
RUN chmod a+x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["apachectl","-D","FOREGROUND"]
|
7
README.md
Normal file
7
README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# lsky-pro-docker
|
||||
|
||||
基于 `php-migrate-docker`,将老旧 PHP 项目迁移到 Docker 中运行
|
||||
|
||||
## 兰空图床 (Lsky Pro)
|
||||
|
||||
为 `lsky-pro` 优化,使用 PHP 7.4 和 Apache
|
8
entrypoint.sh
Normal file
8
entrypoint.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
chown -R www-data /var/www/html
|
||||
chgrp -R www-data /var/www/html
|
||||
chmod -R 755 /var/www/html/
|
||||
|
||||
exec "$@"
|
Loading…
x
Reference in New Issue
Block a user