git clone https://github.com/flxxyz/fast-deploy-website.git && cd fast-deploy-website
docker-compose up -d
-
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
-
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; }
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
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
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
Flxxyz/php: 7.3-cli container has integrated composer
composer: container_name: composer image: composer:latest volumes: - ./ Wwwroot/site name/www:/app command: composer install networks: - site
-
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
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
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: container_name: cache restart: always image: redis:6-alpine networks: - site
volumes: - ./ database/redis:/data command: redis-server --appendonly yes
See more settings Redis Description
cache: container_name: cache restart: always image: memcached:1.6-alpine networks: - site
command: memcached -m 64
See more settings Description of mamcached
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
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: 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: 19.03.12
version: 1.24.2 compose file format: 3.7