Skip to content

Commit 27fd8d7

Browse files
committed
Add discuz
1 parent a2b3dfa commit 27fd8d7

File tree

165 files changed

+92
-1188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+92
-1188
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ See [Docker Compose Documentation](https://docs.docker.com/compose/).
2222
## [consul-discovery](consul-discovery)
2323
Using consul to make a service-discoverable architecture.
2424

25+
## [discuz_php_apache_mysql](discuz_php_apache_mysql)
26+
Discuz with apache and mysql.
27+
2528
## [elk](elk)
2629
ELK example.
2730

discuz_php_apache_mysql/Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# discuz + php + apache
2+
FROM php:8.1.0-apache
3+
MAINTAINER yeasy@github
4+
5+
RUN docker-php-ext-install mysqli; \
6+
docker-php-ext-install pdo_mysql; \
7+
apt-get update && \
8+
apt-get install -y unzip
9+
10+
# Download discuz 3.5 and copy to /var/www/html
11+
RUN curl -L -o /tmp/discuz.zip https://gitee.com/Discuz/DiscuzX/releases/download/v3.5-20230316/Discuz_X3.5_SC_UTF8_20230316.zip && \
12+
#COPY ./Discuz_X3.5_SC_UTF8_20230316.zip /tmp/discuz.zip
13+
unzip /tmp/discuz.zip -d /tmp/discuz && \
14+
cp -r /tmp/discuz/upload/* $PWD && \
15+
rm -rf /tmp/*
16+
17+
# Backup and let config be moutable later
18+
RUN cp -rf config config_default; \
19+
sed -i "s|./config/config_global_default.php|./config_default/config_global_default.php|g" install/index.php
20+
21+
RUN chmod a+w -R config data uc_server/data uc_client/data
22+
23+
# After install, need to remove the install/index.php

discuz_php_apache_mysql/backup.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
DISCUZ_DIR=${HOME}/discuz_php_apache_mysql
2+
3+
cd ${DISCUZ_DIR}
4+
5+
echo "Stopping website"
6+
docker-compose --env-file ./.env down
7+
8+
sleep 2
9+
10+
echo "Backuping data"
11+
sudo tar -czf /${HOME}/discuz_$(date +%Y%m%d).tar.gz ${DISCUZ_DIR}
12+
13+
echo "Starting website"
14+
docker-compose --env-file ./.env up
15+
16+
cd -
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: "3"
2+
3+
services:
4+
mysql:
5+
image: mysql:8
6+
container_name: mysql
7+
hostname: mysql
8+
restart: always
9+
volumes:
10+
- ./volumes/mysql:/var/lib/mysql:rw
11+
environment: # match discuz default settings
12+
- TZ=${TIME_ZONE:-Asia/Shanghai}
13+
- MYSQL_DATABASE=${MYSQL_DATABASE:-testdb}
14+
- MYSQL_USER=${MYSQL_USER:-testuser}
15+
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-testpass}
16+
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-testrootpass}
17+
18+
discuz: # discuz+php+apache. db host=mysql
19+
image: yeasy/discuz:3.5 # build based on the local dockerfile
20+
container_name: discuz
21+
hostname: discuz
22+
restart: always
23+
ports:
24+
- 80:80
25+
volumes:
26+
- ./volumes/discuz-config:/var/www/html/config:rw
27+
- ./volumes/discuz-data:/var/www/html/data:rw
28+
- ./volumes/discuz-uc_client/data:/var/www/html/uc_client/data:rw
29+
- ./volumes/discuz-uc_server/data:/var/www/html/uc_server/data:rw
30+
environment:
31+
- TZ=${TIME_ZONE:-Asia/Shanghai}
32+
command: ${DISCUZ_RUN_CMD:-"apache2-foreground"}
33+
depends_on:
34+
- mysql

discuz_php_apache_mysql/start.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DISCUZ_DIR=${HOME}/discuz_php_apache_mysql
2+
3+
cd ${DISCUZ_DIR}
4+
5+
echo "Starting website"
6+
docker-compose --env-file ./.env up
7+
8+
cd -

discuz_php_apache_mysql/stop.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DISCUZ_DIR=${HOME}/discuz_php_apache_mysql
2+
3+
cd ${DISCUZ_DIR}
4+
5+
echo "Stopping website"
6+
docker-compose --env-file ./.env down
7+
8+
cd -

lnmp_discuz/.env

-18
This file was deleted.

lnmp_discuz/README.md

-97
This file was deleted.

lnmp_discuz/db_data/#ib_16384_0.dblwr

-192 KB
Binary file not shown.

lnmp_discuz/db_data/#ib_16384_1.dblwr

-8.19 MB
Binary file not shown.

lnmp_discuz/db_data/auto.cnf

-2
This file was deleted.

lnmp_discuz/db_data/binlog.000001

-2.97 MB
Binary file not shown.

lnmp_discuz/db_data/binlog.000002

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000003

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000004

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000005

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000006

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000007

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000008

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000009

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000010

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000011

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.000012

-180 Bytes
Binary file not shown.

lnmp_discuz/db_data/binlog.index

-12
This file was deleted.

lnmp_discuz/db_data/ca-key.pem

-1.64 KB
Binary file not shown.

lnmp_discuz/db_data/ca.pem

-1.09 KB
Binary file not shown.

lnmp_discuz/db_data/client-cert.pem

-1.09 KB
Binary file not shown.

lnmp_discuz/db_data/client-key.pem

-1.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)