W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
docker-compose 下載地址
目錄結(jié)構(gòu)
crmeb
docker-compose docker compose 配置文件目錄
mysql mysql配置文件目錄— nginx nginx配置文件目錄
— php php配置文件目錄
— redis redis配置文件目錄
web 程序目錄
docker-compose.yml docker-compose 運(yùn)行配置文件
READMD.md 使用說(shuō)明文件
1、docker-compose 配置文件說(shuō)明
version: “3.3”
services:
mysql: container_name: crmeb_mysql #指定容器名 image: daocloud.io/library/mysql:5.7.5-m15 #M1芯片可以采用這個(gè)鏡像
## image: mysql:5.7 #一般電腦可以用這個(gè)鏡像
ports:
- 3306:3306
## 環(huán)境變量
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: '123456'
MYSQL_USER: 'crmeb'
MYSQL_PASS: '123456'
MYSQL_DATABASE: 'crmeb'
privileged: true
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--max_allowed_packet=128M
--default-authentication-plugin=mysql_native_password
--sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
working_dir: /var/lib/mysql
volumes:
- ./docker-compose/mysql/my.cnf:/etc/mysql/my.cnf
- ./docker-compose/mysql/data:/var/lib/mysql #掛載數(shù)據(jù)目錄到本地
- ./docker-compose/mysql/log:/var/log/mysql
networks:
app_net:
# 固定子網(wǎng)ip,網(wǎng)段必須在子網(wǎng)絡(luò)192.168.*.*
ipv4_address: 192.168.10.1
redis: container_name: crmeb_redis image: ‘redis:alpine’
## image: daocloud.io/library/redis:6.0.5-alpine
## image: redis:5.0
ports:
- "6379:6379"
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
# - ./docker-compose/redis/data:/data #掛載數(shù)據(jù)目錄到本地
- ./docker-compose/redis/redis.conf:/usr/local/etc/redis/redis.conf
networks:
app_net:
ipv4_address: 192.168.10.10
phpfpm: container_name: crmeb_php #指定容器名
## image: phpfpm-image #指定鏡像名
image: crmeb_php #指定鏡像名
build:
context: ./docker-compose/php #dockerfile文件路徑
dockerfile: Dockerfile #制定dockerfile文件名稱
restart: always
environment:
TZ: Asia/Shanghai
ports:
- 9000:9000
- 20002:20002
- 20003:20003
tmpfs: /var/temp #上傳臨時(shí)文件夾
working_dir: /var/www
volumes:
- ./web:/var/www #程序運(yùn)行目錄
- ./docker-compose/php/php-ini-overrides.ini:/etc/php/7.4/fpm/conf.d/99-overrides.ini
## command: php think workerman start --d
networks:
app_net:
ipv4_address: 192.168.10.90
nginx: container_name: crmeb_nginx image: ‘nginx:alpine’
## image: daocloud.io/library/nginx:1.19.1-alpine
restart: always
ports:
- 80:80
# - 443:443
## 依賴關(guān)系 先跑php
depends_on:
- phpfpm
environment:
TZ: Asia/Shanghai
working_dir: /var/www
volumes_from:
- phpfpm #繼承phpfpm掛載目錄
volumes:
- ./docker-compose/nginx/vhost.conf:/etc/nginx/conf.d/default.conf
- ./docker-compose/nginx/log:/etc/nginx/log
networks:
app_net:
ipv4_address: 192.168.10.80
networks: #網(wǎng)絡(luò)配置 app_net: #網(wǎng)絡(luò)名稱 driver: bridge ipam: #網(wǎng)絡(luò)配置 config:
- subnet: 192.168.0.0/16 #IP區(qū)間
gateway: 192.168.10.100
2、運(yùn)行說(shuō)明
1、安裝docker
docker 官網(wǎng)下載
https://www.docker.com/products/docker-desktop
curl -sSL https://get.daocloud.io/docker | sh
https://gitee.com/ZhongBangKeJi/CRMEB
建議去下載最新開(kāi)源代碼 http://localhost/
進(jìn)入CRMEB目錄
docker-compose up -d
或者
make build //創(chuàng)建容器
make run //啟動(dòng)容器
make stop //停止compose 刪除容器
Host:192.168.10.1
Post:3306
user:root
pwd:123456
Host:192.168.10.10
Post:6379
db:0
pwd:123456
端口被占用進(jìn)入docker-compose.yml
里面修改端口
需要進(jìn)入 php 容器,啟動(dòng)長(zhǎng)連接和隊(duì)列
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: