Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

flxxyz/fast-deploy-website

Folders and files

Name Name
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

start

Pull Configuration

 git clone  https://github.com/flxxyz/fast-deploy-website.git  && cd fast-deploy-website

Start Instance

 docker-compose up -d

Add Site

stay wwwroot New Directory Site Directory deposit Site Files

  1. Add the following code block to docker-compose.yml
 Site name: Container_name: site name restart: always image: flxxyz/php:7.3-fpm volumes: - ./ Wwwroot/Site name:/var/www/html networks: - site
  1. newly build nginx.conf File to Wwwroot/site name/conf Save in directory
 server { listen 80; server_name example.com;  # Pay attention to modifying the domain name Root/usr/share/nginx/html/site directory/www; index index.html index.htm index.php; #Some default rewrite rules (larravel, phpwind, thinkphp, typecho, wordpress) can be used, and custom rules can be added and placed in nginx/rewrite.d #include /etc/nginx/rewrite.d/typecho.rewrite; location ~ \.php$ { Fastcgi_pass site name: 9000; fastcgi_index index.php; include       fastcgi_params; fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; } Error_log/var/log/nginx/site name. error.log; Access_log/var/log/nginx/site name.access.log; }

Need to modify php.ini or php-fpm The configuration can follow the following path

 volumes: - ./ Wwwroot/Site name/conf/fpm. conf:/usr/local/etc/php fpm. d/www.conf - ./ Wwwroot/site name/conf/php. ini:/usr/local/etc/php/php. ini

Add CLI application

CLI container open port 9000-9050

 default-cli: container_name: default-cli restart: always image: flxxyz/php:7.3-cli volumes: - ./ wwwroot/default-cli/www:/usr/src/myapp command: php /usr/src/myapp/index.php networks: - site

Using laravelS

 laravels: container_name: laravels restart: always image: flxxyz/php:7.3-cli ports: -"Custom TCP local port: 9001/tcp" -"Custom UDP local port: 9002/udp" volumes: - ./ wwwroot/laravels/www:/usr/src/myapp command: php bin/laravels start networks: - site

The specific code can be viewed docker-compose.yml How to view TCP, UDP, and Websocket related functions app/Services

Composer installation dependency

Flxxyz/php: 7.3-cli container has integrated composer

Add a path to be executed for composer instance mapping

 composer: container_name: composer image: composer:latest volumes: - ./ Wwwroot/site name/www:/app command: composer install networks: - site

ngx-fancyindex

flxxyz/nginx All tags are installed by default

Some additional php extensions

  • bcmath
  • gd
  • inotify
  • intl
  • libxml
  • mcrypt
  • memcached
  • mongodb
  • mysqli
  • mysqlnd
  • openssl
  • pcntl
  • opcache
  • pcntl
  • pdo_mysql
  • pdo_sqlite
  • readline
  • redis
  • SimpleXML
  • soap
  • sockets
  • sqlite3
  • standard
  • Swoole (only flxxyz/php:7.3-cli Installation)
  • xml
  • xmlrpc
  • xmlwriter
  • xsl
  • tokenizer
  • yaml
  • zip
  • zlib

data base

mariadb

 db: container_name: db restart: always image: mariadb:10.5-focal environment: MYSQL_ROOT_PASSWORD: 12345678 volumes: - ./ database/mariadb:/var/lib/mysql networks: - site

See more settings Mariadb description

mongo

 db: container_name: db restart: always image: mongo:4.4-bionic environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: 12345678 volumes: - ./ database/mongo:/data/db networks: - site

See more settings Mongo description

cache

redis

 cache: container_name: cache restart: always image: redis:6-alpine networks: - site

Persistent storage

 volumes: - ./ database/redis:/data command: redis-server --appendonly yes

See more settings Redis Description

memcached

 cache: container_name: cache restart: always image: memcached:1.6-alpine networks: - site

Set the memory size used

 command: memcached -m 64

See more settings Description of mamcached

Search Engines

elasticsearch

 es01: container_name: es01 restart: always image: elasticsearch:7.9.0 environment: - node.name=es01 - cluster.name=es-docker-cluster - discovery.seed_hosts=es02 - cluster.initial_master_nodes=es01,es02 - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 volumes: - ./ database/es/node01:/usr/share/elasticsearch/data ports: - "9200:9200" - "9300:9300" networks: - site es02: container_name: es02 restart: always image: elasticsearch:7.9.1 environment: - node.name=es02 - cluster.name=es-docker-cluster - discovery.seed_hosts=es01 - cluster.initial_master_nodes=es01,es02 - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 volumes: - ./ database/es/node02:/usr/share/elasticsearchdata networks: - site

See more settings Elasticsearch Description

Use Docker to install Elasticsearch

Message Queue

rabbitmq

 amqp: container_name: amqp restart: always image: rabbitmq:3.8 environment: - RABBITMQ_DEFAULT_USER=amqp - RABBITMQ_DEFAULT_PASS=12345678 volumes: - ./ database/amqp:/var/lib/rabbitmq ports: - "15672:15672" networks: - site

See more settings Rabbitmq Description

DNS

pi-hole

 dns: container_name: dns restart: unless-stopped image: pihole/pihole:latest environment: - TZ='Asia/Shanghai' - WEBPASSWORD=12345678 volumes: - ./ database/pihole/:/etc/pihole/:z - ./ database/dnsmasq.d/:/etc/dnsmasq.d/:z ports: - "53:53/tcp" - "53:53/udp" - "67:67/udp" - "9080:80" - "9443:443" networks: - site

See more settings Pihole description

Version used when configuring instances

docker

version: 19.03.12

docker-compose

version: 1.24.2 compose file format: 3.7

About

Docker rapid multi site deployment environment

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published