企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` version: '3' services: # jk自动化容器 jenkins: image: jenkins/jenkins:lts user: root # 为了避免一些权限问题 在这我使用了root ports: - 9999:8080 - 50000:50000 volumes: # 卷挂载路径 - ./wwwroot:/wwwroot #程序运行目录 - /var/run/docker.sock:/var/run/docker.sock - /usr/bin/docker:/usr/bin/docker - /etc/docker/daemon.json:/etc/docker/daemon.json - ./jenkins_home/:/var/jenkins_home # 这是我们一开始创建的目录挂载到容器内的jenkins_home目录 environment: - TZ=Asia/Shanghai restart: always # mysql容器 mysql: container_name: lnmp_mysql image: mysql:5.7 restart: always ports: - 33061:3306 volumes: - ./mysql/my.cnf:/etc/mysql/my.cnf - ./mysql/data:/var/lib/mysql #挂载数据目录到本地 - ./mysql/log:/var/log/mysql command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --explicit_defaults_for_timestamp=true --lower_case_table_names=1 --max_allowed_packet=256M --default-authentication-plugin=mysql_native_password --sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" environment: TZ: Asia/Shanghai MYSQL_ROOT_PASSWORD: '123456' MYSQL_DATABASE: 'docker_bjl_mysql' MYSQL_USER: 'docker_bjl_mysql' MYSQL_PASSWORD: '123456' # nginx容器 nginx: container_name: lnmp_nginx image: nginx ports: - 8080:80 - 4000:443 working_dir: /wwwroot volumes_from: - php7.4 #继承phpfpm挂载目录 volumes: - ./html:/usr/share/nginx/html - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/conf.d:/etc/nginx/conf.d - ./nginx/logs:/var/log/nginx depends_on: - php7.4 restart: always logging: driver: 'json-file' options: max-size: '10g' # php7.4容器 php7.4: container_name: lnmp_php74 build: context: ./php/php74 # dockerfile文件路径 dockerfile: Dockerfile # 指定dockerfile文件名称 expose: - 9000 ports: - "9000:9000" links: - mysql:mysql environment: TZ: Asia/Shanghai volumes: - ./wwwroot:/wwwroot #程序运行目录 - ./php/php74/php.ini:/usr/local/etc/php/php74/php.ini:rw restart: always logging: driver: 'json-file' options: max-size: '10g' ```