new file: Dockerfile

modified:   README.md
	new file:   docker-compose.yml
This commit is contained in:
zhangyuheng 2023-12-05 14:19:12 +08:00
parent ce0fc84662
commit 1d97e0d568
3 changed files with 101 additions and 0 deletions

28
Dockerfile Normal file
View File

@ -0,0 +1,28 @@
FROM php:8.0.2-apache
RUN apt update && \
apt install wget -y && \
cd /usr/local/bin && \
wget -c https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
RUN chmod +x /usr/local/bin/install-php-extensions && \
export http_proxy=http://192.168.27.1:7890 && \
export https_proxy=http://192.168.27.1:7890 && \
install-php-extensions gd zip pdo_dblib pdo_pgsql pdo_mysql
WORKDIR /app
RUN wget -e "https_proxy=http://192.168.27.1:7890" -c https://github.com/bs-community/blessing-skin-server/releases/download/6.0.2/blessing-skin-server-6.0.2.zip && \
apt update && apt install unzip -y && \
unzip blessing-skin-server-6.0.2.zip && \
mv .env.example .env && \
mv .env storage/ && \
ln -s storage/.env .env && \
mkdir storage/plugins
ENV APACHE_DOCUMENT_ROOT /app/public
RUN chown -R www-data:www-data . && \
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf && \
a2enmod rewrite headers

View File

@ -1,2 +1,54 @@
# blessing-skin-in-docker
在容器中运行 Blessing Skin Server
## 1. 准备镜像
```
git clone https://ssl.lunadeer.cn:14446/zhangyuheng/blessing-skin-in-docker.git
cd blessing-skin-server
docker build -t blessing-skin:6.0.2 .
```
## 2. 初始化数据
```
cd /some/where/your/dir
mkdir blessing-skin
cd blessing-skin
mkdir storage
```
在 docker-compose.yml 文件中写入以下内容:
```
version: "3.7"
services:
blessing-skin:
image: blessing-skin:6.0.2
container_name: blessing-skin
restart: always
ports:
- 8013:80
environment:
- TZ=Asia/Shanghai
volumes:
- blessing-skin-storage:/app/storage
volumes:
blessing-skin-storage:
name: blessing-skin-storage
driver: local
driver_opts:
o: bind
type: none
device: ./storage
```
## 3. 运行
```
docker compose up -d
```
> 你的所有数据将存储在 storage 下如果希望使用sqlite数据库请将数据库路径设置在 `/app/storage` 下。

21
docker-compose.yml Normal file
View File

@ -0,0 +1,21 @@
version: "3.7"
services:
blessing-skin:
image: blessing-skin:6.0.2
container_name: blessing-skin
restart: always
ports:
- 8013:80
environment:
- TZ=Asia/Shanghai
volumes:
- blessing-skin-storage:/app/storage
volumes:
blessing-skin-storage:
name: blessing-skin-storage
driver: local
driver_opts:
o: bind
type: none
device: ./storage