`
sillycat
  • 浏览: 2543080 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Flarum BBS System(2)Docker the BBS

 
阅读更多
Flarum BBS System(2)Docker the BBS

Change PHP to version 7.1.24 in Docker, it seems everything works fine.

Steps to generate the latest PHP Project
In the working directory
> mkdir flarum
> cd flarum/
> composer create-project flarum/flarum . --stability=beta

It seems we need execute the command to install the dependency
> composer install

Here is the Docker Related Configuration
Command to execute the PHP and Nginx in start.sh
#!/bin/sh -ex

cd /tool/php-7.1.24
sbin/php-fpm -R
cd /tool/nginx-1.14.0
sbin/nginx -g "daemon off;"

Makefile to operate all the steps to build the image

PORT = 8081

IMAGE=sillycat/public
TAG=centos7-flarum
NAME=centos7-flarum-$(PORT)

prepare:
    wget http://am1.php.net/distributions/php-7.1.24.tar.gz -P install/
    wget https://nginx.org/download/nginx-1.14.0.tar.gz -P install/

docker-context:

build: docker-context
    docker build -t $(IMAGE):$(TAG) .

run:
    docker run -d -p $(PORT):80 -v $(shell pwd)/html:/tool/nginx-1.14.0/html --name $(NAME) $(IMAGE):$(TAG)

debug:
    docker run -ti -p $(PORT):80 -v $(shell pwd)/html:/tool/nginx-1.14.0/html --name $(NAME) $(IMAGE):$(TAG) /bin/bash

clean:
    docker stop ${NAME}
    docker rm ${NAME}

logs:
    docker logs ${NAME}

publish:
    docker push ${IMAGE}

Steps to build Image in the Dockerfile
#Set Up PHP FPM

#Prepre the OS
FROM centos:7
MAINTAINER Carl Luo <luohuazju@gmail.com>

#install the softwarea
RUN yum -y update
RUN yum install -y wget gcc make
RUN yum install -y openssl-devel
RUN yum install -y zlib-devel pcre-devel
RUN yum -y install libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel freetype

#install PHP
RUN     mkdir -p /tool
RUN     mkdir -p /install
ADD        install/php-7.1.24.tar.gz /install/
WORKDIR /install/php-7.1.24
RUN     ./configure --prefix=/tool/php-7.1.24 --enable-fpm --with-fpm-user=root --with-fpm-group=root --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-fileinfo --enable-maintainer-zts
RUN     make
RUN      make install

#config PHP
ADD     conf/www.conf /tool/php-7.1.24/etc/php-fpm.d/
ADD        conf/php-fpm.conf /tool/php-7.1.24/etc/

#install nginx
ADD        install/nginx-1.14.0.tar.gz /install/
WORKDIR /install/nginx-1.14.0
RUN     ./configure --prefix=/tool/nginx-1.14.0
RUN        make
RUN        make install

#config nginx
ADD     conf/nginx.conf /tool/nginx-1.14.0/conf/
RUN        chmod -R 777 /tool/nginx-1.14.0/html/

#start the application
EXPOSE  80
RUN     mkdir -p /app/
ADD     start.sh /app/
WORKDIR /app/
CMD    [ "./start.sh" ]

The nginx.conf to configure the flarum project

user  root root;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  kikokang.ddns.net;

        root   /tool/nginx-1.14.0/html/flarum;
        index index.php index.html index.htm;
        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;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            fastcgi_pass   127.0.0.1:9000;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param HTTP_PROXY "";
            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-revalidat";      
        }
        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/html is gzipped by default by nginx
            text/plain
            text/xml;
        gzip_buffers 16 8k;
        gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    }
}

The important thing is to change the file in html/flarum/config.php, change the URL to your domain
  'url' => 'https://kikokang.ddns.net’,

But I think this is setup by the first step when you put your database information there.

How to Setup The Email
First login in as admin, on the drop down menu, choose ‘adminitrator’ —> Email, here is one example for GMAIL
SMTP Server
Driver: smtp
Host: smtp.gmail.com
Port: 465
Encryption: ssl
SMTP Account:
Username: xxxxx@gmail.com
Password: xxxxx
Addresses:
Sender: xxxxxx@gmail.com

I followed this discussion
https://discuss.flarum.org/d/4979-sign-up-and-email-not-working/28

You need to go to your gmail.  Click on ‘Account’ —> “Sign-in & security” —> Apps with account access —> “Allow less secure apps: ON"

You may need to check your security alert emails to confirm you are the one who attempt to login as well.

References:
http://sillycat.iteye.com/blog/2433972
Email Configuration
https://discuss.flarum.org/d/879-how-do-i-change-email-settings-to-gmail-smtp/3


分享到:
评论

相关推荐

    docker-flarum:Flarum的Docker映像

    蒙代尼 标签可用 最新 稳定 0.1.0-beta.16 0.1.0-beta.15 特征 .../ flarum / app / public / assets :Flarum资产目录 / flarum / app / extensions :Flarum扩展目录 / etc / nginx / flarum :

    docker-flarum:基于Alpine Linux的Flarum Docker映像

    关于基于Alpine Linux的 Docker映像。 如果您有兴趣,我的其他Docker映像! :light_bulb: 想要收到新版本的通知吗...flarum.gitcd docker-flarum# Build image and output to docker (default)docker buildx bake# Bui

    boot2docker_v19.03.5.zip

    描述提到"最新版 boot2docker.iso",说明这个ISO文件是boot2docker的最新发行版,"安装、启动docker的必备文件"暗示了boot2docker用于在不同的平台上快速启动Docker环境,特别是对于那些不支持直接安装Docker的系统...

    boot2docker.iso的v18.02.0-ce版本

    **Boot2Docker ISO的v18.02.0-ce版本详解** Boot2Docker是一款轻量级的Linux发行版,专为在Docker容器上运行而设计。它的主要目的是提供一个简单、快速的方式来运行Docker主机,尤其适合开发者在本地环境中进行...

    boot2docker v18.06.0-ce

    来自 https://github.com/boot2docker/boot2docker/releases/download/v18.06.0-ce/boot2docker.iso

    boot2docker.iso国内下载v19.03.12

    boot2docker.iso国内下载v19.03.12,复制文件boot2docker.iso到C:\Users\mid1507\.docker\machine\cache\boot2docker.iso目录,重新打开Docker Quickstart Terminal。

    docker安装 toolbox boot2docker

    boot2docker v18,docker安装包,toolbox安装包 windows版本

    boot2docker

    boot2docker boot2docker boot2docker boot2docker boot2docker

    boot2docker.iso的v18.05.0-ce版本

    **Boot2Docker ISO的V18.05.0-CE版本详解** Boot2Docker是一款轻量级的Linux发行版,专为在虚拟机上运行Docker容器而设计。它提供了一个精简的环境,使用户能够在任何支持虚拟化的平台上快速启动Docker服务,如...

    boot2docker.iso-v19.03.12.zip

    在Docker首次启动时需要下载的一个boot2docker.iso,但是因为这个文件的官方位置是在 GitHub,所以在国内不一定能下载下来 下载后,复制文件boot2docker.iso到C:\Users\xianyi\.docker\machine\cache\boot2docker....

    boot2docker for v18.06.0-ce

    window dockerbox中需要的启动镜像,对应版本v18.06.0-ce 下载解压后保存到位置(默认安装情况下) C:\Users\您的用户名\.docker\machine\machines\default\boot2docker.iso

    boot2docker.isov19.03.12

    boot2docker.iso docker 最新版本镜像文件v19.03.12.在github上下载太慢以及下载不下来。放到csdn 上方便快速下载使用

    boot2docker.iso的v17.12.1-ce版本.zip

    从https://github.com/下载下来的,boot2docker.iso镜像,v17.12.1-ce版本的。

    boot2docker.iso v17.12.1-ce

    从https://github.com/boot2docker/boot2docker/releases下载下来的

    v19.03.0/boot2docker.iso

    https://github.com/boot2docker/boot2docker/releases 最新boot2docker v19.03.0/boot2docker.iso

    boot2docker-v18.09.1-rc1

    Warning: the AUFS storage driver is deprecated in boot2docker and AUFS support is removed in 18.09+. You can continue with AUFS in boot2docker 18.06.x, but it is recommended to reset your disk image ...

    boot2docker.zip-v19.03.5

    docker安装卡死在boot2docker.iso的下载,下载完之后放到C:\Users\xxx\.docker\machine\cache目录下,并删除之前未下载成功的tmp文件

    boot2docker-v17.06.2-ce.iso.zip

    boot2docker.iso v17.06.2-ce 版本。 在使用 docker-machine 时用到。 macOS: 将其拷贝至 ~/.docker/machine/cache/ Boot2Docker是一个专为Docker而设计的轻量级Linux发行包,解决Win或者OS X用户不能安装Docker的...

    docker java连接数据库报错 The server selected protocol version T.pdf

    docker java连接数据库报错 The server selected protocol version T

    boot2docker.iso

    亲测可用 docker-machine create --driver virtualbox manager1

Global site tag (gtag.js) - Google Analytics