开发个人OpenUI–2 环境搭建
2.1 环境要求
-
Golang
1.22 -
Etcd
-
Docker
-
Redis
-
Mysql
2.2Docker
本地开发环境搭建
这里使用 Docker Compose
来编排管理我们的容器,docker-compose.yaml
:
version: '3.8'services:mysql:image: mysql:8.0.18container_name: mysqlenvironment:- MYSQL_ROOT_PASSWORD=123456volumes:- ./mysql/data:/var/lib/mysql- /etc/localtime:/etc/localtime:roports:- 3306:3306restart: alwaysnetworks:- defaultredis:volumes:- ./redis/data:/datacontainer_name: openui-redistty: truerestart: alwaysprivileged: trueimage: redis:latestnetworks:- defaultetcd:image: bitnami/etcd:3deploy:restart: alwaysprivileged: truevolumes:- ./etcd/data:/bitnami/etcd/dataenvironment:- "ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379"- "ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379"ports:- 2379:2379networks:- default # 网络保持统一,服务间连接使用容器名networks:default:external: truename: openui-backend_default
2.2.1 部署目录
├── 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)
GitHub - jackwillsmith/openui-backend-go: openui-backend-go