# 开发个人Ollama-Chat--2 环境搭建
## 2.1 环境要求
- `Golang` 1.22
- `Etcd`
- `Docker`
- `Redis`
- `Mysql`
## 2.2`Docker`本地开发环境搭建
这里使用 `Docker Compose` 来编排管理我们的容器,`docker-compose.yaml`:
```yaml
version: '3.8'
services:
mysql:
image: mysql:8.0.18
container_name: mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
volumes:
- ./mysql/data:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
ports:
- 3306:3306
restart: always
networks:
- default
redis:
volumes:
- ./redis/data:/data
container_name: openui-redis
tty: true
restart: always
privileged: true
image: redis:latest
networks:
- default
etcd:
image: bitnami/etcd:3
deploy:
restart: always
privileged: true
volumes:
- ./etcd/data:/bitnami/etcd/data
environment:
- "ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379"
- "ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379"
ports:
- 2379:2379
networks:
- default # 网络保持统一,服务间连接使用容器名
networks:
default:
external: true
name: openui-backend_default
```
### 2.2.1 部署目录
```bash
├── docker-compose.yaml
├── etcd
│ └── data
├── mysql
│ └── data
├── redis
│ └── data
│ └── dump.rdb
```
### 2.2.2 容器说明
| 容器名称 | 暴露端口 | 注释 |
| --- | --- | --- |
| etcd | 2379:2379 | 服务注册,发现 |
| mysql | 3306:3306 | 存储数据 |
| redis | 6379:6379 | 缓存数据 |
## 项目地址
[jackwillsmith/openui-svelte-build (github.com)](https://github.com/jackwillsmith/openui-svelte-build/)
[GitHub - jackwillsmith/openui-backend-go: openui-backend-go](https://github.com/jackwillsmith/openui-backend-go.git)
有疑问加站长微信联系(非本文作者))