标签 docker 下的文章

从github换到flarum,捣鼓了下,记录一些问题。

使用的docker安装的,比较省事,直接pull下来处理就行了,下面是相关配置文件

docker-compose.yml

version: "3"

services:
  flarum:
    image: registry.cn-hangzhou.aliyuncs.com/flarumchina/nginx-flarum:latest
    container_name: flarum
    ports:
      - 80:8888
      - 443:443
    env_file:
      - ./flarum.env
    volumes:
      - ./assets:/flarum/app/public/assets
      - ./extensions:/flarum/app/extensions
      - ./nginx:/etc/nginx/conf.d
      - ./cert:/etc/nginx/cert
      - ./nginx.conf:/etc/nginx/nginx.conf
    depends_on:
      - mysql
    restart: always

  mysql:
    image: mysql:5.7
    container_name: flarum-mysql
    ports:
      - 3306:3306
    environment:
      - MYSQL_ROOT_PASSWORD=root password
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=your password
    volumes:
      - ./db:/var/lib/mysql
    restart: always

- 阅读剩余部分 -

version: '3'

services:
  mysql:
    container_name: jjit_mysql
    restart: always
    image: mysql:5.7
    ports:
      - 3306:3306
    volumes:
      - ./mysql/data:/var/lib/mysql
      - ./mysql/my.cnf:/etc/my.cnf
    environment:
      MYSQL_ROOT_PASSWORD: password

  nginx:
    container_name: jjit_nginx
    restart: always
    image: nginx:latest
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx/www:/usr/share/nginx/html
      - ./nginx/conf.d:/etc/nginx/conf.d
      - ./nginx/cert:/etc/nginx/cert
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/log/error.log:/var/log/nginx/error.log
    links:
      - tomcat:t1

  tomcat:
    container_name: jjit_tomcat
    restart: always
    image: tomcat:latest
    ports:
      - 8080:8080
      - 8009:8009
      - 8443:8443
    volumes:
      - ./tomcat/webapps:/usr/local/tomcat/webapps
      - ./tomcat/conf:/usr/local/tomcat/conf
      - ./tomcat/logs:/usr/local/tomcat/logs
    links:
      - mysql:m1