Docker: docker-compose
2022/3/21 0:01:32
本文主要是介绍Docker: docker-compose,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
version: "3.9" volumes: data: external: false config: external: false plugins: external: false kibana: external: false networks: demo: name: demo external: false ipam: driver: default config: - subnet: 10.0.0.0/24 services: elasticsearch: container_name: elasticsearch image: elasticsearch:8.1.0 ports: - 9200:9200 - 9300:9300 networks: - elasticsearch environment: - discovery.type=single-node - ES_JAVA_OPTS=-Xms512m -Xmx512m volumes: - data:/usr/share/elasticsearch/data - config:/usr/share/elasticsearch/config - plugins:/usr/share/elasticsearch/plugins kibana: container_name: kibana image: kibana:8.1.0 ports: - 5601:5601 networks: - elasticsearch volumes: - kibana:/usr/share/kibana/config depends_on: - elasticsearch demo: build: context: demo # Dockerfile所在目录 dockerfile: Dockerfile container_name: demo deploy: replicas: 1 resources: limits: cpus: "0.50" memory: 500M reservations: memory: 500M restart_policy: condition: on-failure max_attempts: 3 dns: - 8.8.8.8 - 9.9.9.9 dns_search: - dc1.example.com - dc2.example.com entrypoint: /code/entrypoint.sh entrypoint: ["php", "-d", "memory_limit=-1", "vendor/bin/phpunit"] env_file: - ./common.env - ./apps/web.env - /opt/runtime_opts.env command: "redis-server --appendonly yes" ports: - target: 80 published: 8080 protocol: tcp mode: host healthcheck: test: ['CMD','curl','-f','http://localhost'] interval: 1m30s timeout: 10s retries: 3 sysctls: - net.core.somaxconn=1024 - net.ipv4.tcp_syncookies=0 ulimits: nproc: 65535 nofile: soft: 20000 hard: 40000 logging: driver: "json-file" options: max-size: "200k" max-file: "10" volumes: - type: volume source: mydata target: /data volume: nocopy: true - type: bind source: ./static target: /opt/app/static
这篇关于Docker: docker-compose的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-17docker 里面的postgis没有中文支持,如何解决?-icode9专业技术文章分享
- 2024-11-17宿主机上开了阿里云的代理,在docker容器内ping不通阿里云的内网ip什么原因?-icode9专业技术文章分享
- 2024-11-17怎么配置docker dns?-icode9专业技术文章分享
- 2024-11-15在树莓派上用Docker-in-Docker模拟Docker Swarm集群
- 2024-11-14Docker端口:你真的公开了哪些东西?
- 2024-11-14用DOCKER在家里的实验室里搞些酷炫的玩意儿
- 2024-11-05掌握Docker:高效安全的十大最佳实践
- 2024-11-05在 Docker Compose 中怎么设置端口映射-icode9专业技术文章分享
- 2024-11-05在 Docker Compose 中怎么设置环境变量-icode9专业技术文章分享
- 2024-11-04Docker环境部署项目实战:新手入门教程