feat: docker mysql and redis

This commit is contained in:
zzw
2026-08-06 13:43:52 +08:00
parent 58242dee8d
commit c37cedc664
26 changed files with 1349 additions and 129 deletions
+16
View File
@@ -0,0 +1,16 @@
services:
mysql:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "123123"
ports:
- "3306:3306"
volumes:
- ./mysql/data:/var/lib/mysql
# - ./mysql/init:/docker-entrypoint-initdb.d:ro
networks:
default:
external: true
name: services-network
-37
View File
@@ -1,37 +0,0 @@
services:
bff:
image: golang:1.24.3
volumes:
- ..:/src
- go-mod-cache:/go/pkg/mod
working_dir: /src/bff
command: go run . -f etc/bff.yaml
ports:
- "10000:10000"
environment:
NACOS_SERVER_ADDR: rnacos:8848
depends_on:
- rnacos
product:
image: golang:1.24.3
volumes:
- ..:/src
- go-mod-cache:/go/pkg/mod
working_dir: /src/product
command: go run . -f etc/product.yaml
ports:
- "10100:10100"
environment:
NACOS_SERVER_ADDR: rnacos:8848
depends_on:
- rnacos
- redis
volumes:
go-mod-cache:
networks:
default:
external: true
name: server-network
+14
View File
@@ -0,0 +1,14 @@
services:
redis:
image: redis:7.4-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- ./redis/data:/data
command: ["redis-server", "--appendonly", "yes"]
networks:
default:
external: true
name: services-network
+1 -21
View File
@@ -21,27 +21,7 @@ services:
- "9080:9080" # 业务入口
- "9443:9443" # HTTPS
mysql:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "123123"
ports:
- "3306:3306"
volumes:
- ./mysql/data:/var/lib/mysql
# - ./mysql/init:/docker-entrypoint-initdb.d:ro
redis:
image: redis:7.4-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- ./redis/data:/data
command: ["redis-server", "--appendonly", "yes"]
networks:
default:
external: true
name: server-network
name: services-network