Commit a877baf7 by yinsigan

first commit

0 parents
/mariadb/database/*
/flarum/html/assets/*
/flarum/html/storage/*
# hfpp2012/docker-flarum
![logo](https://i.imgur.com/Bjrtbsc.png "logo")
**Don’t use it in production**
### What is this ?
Flarum is the next-generation forum software that makes online discussion fun. It's simple, fast, and free. http://flarum.org/
## Installation
```
docker-compose up --build
composer create-project flarum/flarum flarum/html --stability=beta
composer require zendframework/zend-stratigility:1.2.1 -d flarum/html
```
### install chinese language
```
composer require jsthon/flarum-ext-simplified-chinese -d flarum/html
```
version: '2'
services:
web:
image: nginx:latest
ports:
- 8080:80
volumes:
- ./site.conf:/etc/nginx/conf.d/default.conf
volumes_from:
- flarum
links:
- flarum
networks:
- docker_flarum
- nginx_web
flarum:
build: flarum/
volumes:
- ./flarum/html:/var/www/html
ports:
- "9003:9000"
networks:
- docker_flarum
mariadb:
build: mariadb/
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=flarum
- MYSQL_USER=flarum
- MYSQL_PASSWORD=flarum
volumes:
- ./mariadb/database:/var/lib/mysql
# ports:
# - "3306:3306"
networks:
- docker_flarum
networks:
nginx_web:
external: true
docker_flarum:
driver: bridge
FROM php:5.6-fpm
COPY cn-sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libfreetype6-dev \
libjpeg-dev \
libpng12-dev \
libpq-dev \
libxml2-dev
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install pdo_mysql json opcache gd dom fileinfo
# see https://secure.php.net/manual/en/opcache.installation.php
COPY opcache.ini /usr/local/etc/php/conf.d/opcache-recommended.ini
VOLUME /var/www/html
CMD ["php-fpm"]
deb http://ftp.cn.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.cn.debian.org/debian/ stable main contrib non-free
deb http://ftp.cn.debian.org/debian/ stable-updates main contrib non-free
deb-src http://ftp.cn.debian.org/debian/ stable-updates main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free
deb-src http://security.debian.org/ stable/updates main contrib non-free
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.fast_shutdown=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=5413
opcache.revalidate_freq=60
FROM mariadb
server {
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html;
location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
location /flarum {
deny all;
return 404;
}
location ~* \.php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass flarum:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability
fastcgi_index index.php;
}
location ~* \.html$ {
expires -1;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 1M;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types application/atom+xml
application/javascript
application/json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/html
text/plain
text/xml;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!