compose

Solid

Docker Compose 编排

AI & Automation 1 stars 0 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 79/100

Stars 20%
10
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Docker Compose 编排 ## 概述 多容器编排、环境变量、网络配置等技能。 ## 基础命令 ```bash # 启动服务 docker compose up docker compose up -d # 后台运行 docker compose up --build # 重新构建 # 停止服务 docker compose down docker compose down -v # 同���删除卷 docker compose down --rmi all # 同时删除镜像 # 查看状态 docker compose ps docker compose ps -a # 查看日志 docker compose logs docker compose logs -f # 实时跟踪 docker compose logs service_name # 执行命令 docker compose exec service_name sh docker compose run service_name command # 重启服务 docker compose restart docker compose restart service_name # 扩缩容 docker compose up -d --scale web=3 ``` ## 配置文件 ### 基础结构 ```yaml # docker-compose.yml version: "3.9" services: web: image: nginx:alpine ports: - "80:80" volumes: - ./html:/usr/share/nginx/html depends_on: - api api: build: ./api environment: - DATABASE_URL=postgres://db:5432/mydb depends_on: - db db: image: postgres:15 volumes: - db_data:/var/lib/postgresql/data environment: POSTGRES_PASSWORD: secret volumes: db_data: networks: default: driver: bridge ``` ### 服务配置详解 #### build ```yaml services: app: # 简单形式 build: ./app # 完整形式 build: context: ./app dockerfile: Dockerfile.prod args: - VERSION=1.0 target: production cache_from: - myapp:cache ``` #### ports ```yaml services: web: ports: - "80:80" ...

Details

Author
ryukyagamilight
Repository
ryukyagamilight/terminal-skills
Created
5 months ago
Last Updated
today
Language
N/A
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category