mirror of
https://github.com/10h30/ols-docker-env.git
synced 2026-05-12 15:21:24 +09:00
set env/doc root
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
LITESPEED=1.5.10wp
|
LITESPEED=1.5.10wp
|
||||||
|
|
||||||
|
WEB_ADMIN=123456
|
||||||
|
|
||||||
MYSQL_DATABASE=wordpress
|
MYSQL_DATABASE=wordpress
|
||||||
MYSQL_ROOT_PASSWORD=password
|
MYSQL_ROOT_PASSWORD=password
|
||||||
MYSQL_USER=wordpress
|
MYSQL_USER=wordpress
|
||||||
MYSQL_PASSWORD=password
|
MYSQL_PASSWORD=password
|
||||||
|
|
||||||
#wordpress
|
#wordpress
|
||||||
DOMAIN=example.com
|
DOMAIN=127.0.0.1
|
||||||
ADMIN_USERNAME=admin
|
ADMIN_USERNAME=admin
|
||||||
ADMIN_PASSWORD=password
|
ADMIN_PASSWORD=password
|
||||||
ADMIN_EMAIL=test@test.com
|
ADMIN_EMAIL=test@test.com
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
# ols-docker-env
|
# OpenLiteSpeed WordPress Docker Container
|
||||||
OpenLiteSpeed Docker Environment
|
Lightweight WordPress container with OpenLiteSpeed 1.5.10 & PHP 7.3 based on Ubuntu 18.04 Linux.
|
||||||
##
|
WordPress version will install: Latest
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
1. [Install Docker](https://www.docker.com/)
|
||||||
|
2. [Install Docker Compose](https://docs.docker.com/compose/)
|
||||||
|
3. Clone this repository or copy the files from this repository into a new folder.
|
||||||
|
```
|
||||||
|
git clone https://github.com/litespeedtech/ols-docker-env.git
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
Edit the `.env` file to change the WordPress Domain, user and password, default MySQL root and wordpress password .
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Open a terminal and `cd` to the folder in which `docker-compose.yml` is saved and run:
|
||||||
|
```
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
The containers are now built and running. You should be able to access the WordPress installation with the configured domain in the browser address. By default it is http://127.0.0.1.
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,11 @@ RUN apt-get update && apt-get install -y wget && \
|
|||||||
apt-get install -y curl mysql-client \
|
apt-get install -y curl mysql-client \
|
||||||
lsphp73 lsphp73-mysql lsphp73-opcache lsphp73-curl
|
lsphp73 lsphp73-mysql lsphp73-opcache lsphp73-curl
|
||||||
|
|
||||||
|
RUN echo "admin:$(/usr/local/lsws/admin/fcgi-bin/admin_php* -q /usr/local/lsws/admin/misc/htpasswd.php ${WEB_ADMIN})" \
|
||||||
|
> /usr/local/lsws/admin/conf/htpasswd
|
||||||
|
|
||||||
EXPOSE 7080
|
EXPOSE 7080
|
||||||
|
|
||||||
# get wp-cli
|
|
||||||
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
|
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
|
||||||
chmod +x wp-cli.phar && mv wp-cli.phar /usr/local/bin/wp && \
|
chmod +x wp-cli.phar && mv wp-cli.phar /usr/local/bin/wp && \
|
||||||
ln -s /usr/local/lsws/lsphp73/bin/php7.3 /usr/bin/php
|
ln -s /usr/local/lsws/lsphp73/bin/php7.3 /usr/bin/php
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ expires {
|
|||||||
enableExpires 1
|
enableExpires 1
|
||||||
expiresByType image/*=A604800,text/css=A604800,application/x-javascript=A604800,application/javascript=A604800,font/*=A604800,application/x-font-ttf=A604800
|
expiresByType image/*=A604800,text/css=A604800,application/x-javascript=A604800,application/javascript=A604800,font/*=A604800,application/x-font-ttf=A604800
|
||||||
}
|
}
|
||||||
|
autoLoadHtaccess 1
|
||||||
|
|
||||||
tuning {
|
tuning {
|
||||||
eventDispatcher best
|
eventDispatcher best
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
docRoot $VH_ROOT/html/
|
docRoot /var/www/vhosts/
|
||||||
enableGzip 1
|
enableGzip 1
|
||||||
|
|
||||||
errorlog $VH_ROOT/logs/error.log {
|
errorlog $VH_ROOT/logs/error.log {
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ if [ ! -f "./wp-config.php" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
www_uid=$(stat -c "%u" /var/www/vhosts/localhost)
|
#www_uid=$(stat -c "%u" /var/www/vhosts/localhost)
|
||||||
if [ ${www_uid} -eq 0 ]; then
|
#if [ ${www_uid} -eq 0 ]; then
|
||||||
#echo "./sites/localhost is owned by root, auto changing ownership of ./sites/localhost to uid 1000"
|
# #echo "./sites/localhost is owned by root, auto changing ownership of ./sites/localhost to uid 1000"
|
||||||
chown 1000 /var/www/vhosts/localhost -R
|
# chown 1000 /var/www/vhosts/localhost -R
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
echo "WordPress installation finished."
|
echo "WordPress installation finished."
|
||||||
exec "$@"
|
exec "$@"
|
||||||
Reference in New Issue
Block a user