Update from Sync Service

This commit is contained in:
FNS Service
2026-04-21 20:00:16 +08:00
parent e1e983f8f3
commit 989da7194a
6 changed files with 407 additions and 104 deletions

View File

@@ -1,4 +1,70 @@
## INSTALL AS A CONTAINER
## Compose can also be run inside a container, from a small bash script wrapper. To install compose as a container run this command:
sudo curl -L --fail [https://github.com/docker/compose/releases/download/1.25.4/run.sh](https://github.com/docker/compose/releases/download/1.25.4/run.sh) -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-compose
> 来自 <[https://docs.docker.com/compose/install/#alternative-install-options](https://docs.docker.com/compose/install/#alternative-install-options)>
# 安装 Docker Compose
## 方式一:作为容器运行(推荐)
Docker Compose 可以作为容器运行,通过一个轻量级 bash 脚本调用。
```bash
# 下载并安装
sudo curl -L --fail \
https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-$(uname -s)-$(uname -m) \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# 验证安装
docker-compose --version
```
## 方式二pip 安装
```bash
pip install docker-compose
```
## 方式三standalone 二进制
```bash
# 下载指定版本
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d'"' -f4)
curl -L \
"https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
```
## 快速使用
```yaml
# docker-compose.yml 示例
version: '3.8'
services:
web:
image: nginx:latest
ports:
- "80:80"
db:
image: postgres:13
environment:
POSTGRES_PASSWORD: secret
```
```bash
# 启动服务
docker-compose up -d
# 查看状态
docker-compose ps
# 查看日志
docker-compose logs -f
# 停止服务
docker-compose down
```
---
> 参考:[Docker Compose 官方文档](https://docs.docker.com/compose/)