1+ version : " 3.0"
2+ name : memos-dev
13services :
24 db :
35 image : mysql
46 volumes :
5- - ./.air/mysql:/var/lib/mysql
7+ - ./../.air/mysql:/var/lib/mysql
8+ environment :
9+ MYSQL_ALLOW_EMPTY_PASSWORD : yes
10+ MYSQL_DATABASE : memos
611 api :
712 image : cosmtrek/air
813 working_dir : /work
@@ -11,8 +16,8 @@ services:
1116 - " MEMOS_DSN=root@tcp(db)/memos"
1217 - " MEMOS_DRIVER=mysql"
1318 volumes :
14- - .:/work/
15- - .air/go-build:/root/.cache/go-build
19+ - ./.. :/work/
20+ - ./../. air/go-build:/root/.cache/go-build
1621 - $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host
1722 web :
1823 image : node:20-alpine
@@ -23,8 +28,7 @@ services:
2328 entrypoint : ["/bin/sh", "-c"]
2429 command : ["corepack enable && pnpm install && pnpm dev"]
2530 volumes :
26- - ./web:/work
27- - ./.air/node_modules/:/work/node_modules/ # Cache for Node Modules
31+ - ./../web:/work
2832
2933 # Services below are used for developers to run once
3034 #
@@ -43,8 +47,8 @@ services:
4347 working_dir : /work/proto
4448 command : generate
4549 volumes :
46- - ./proto:/work/proto
47- - ./web/src/types/:/work/web/src/types/
50+ - ./../ proto:/work/proto
51+ - ./../ web/src/types/:/work/web/src/types/
4852
4953 # Do golang static code check before create PR
5054 golangci-lint :
@@ -55,8 +59,8 @@ services:
5559 command : run -v
5660 volumes :
5761 - $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host
58- - .air/go-build:/root/.cache/go-build
59- - .:/work/
62+ - ./../. air/go-build:/root/.cache/go-build
63+ - ./.. :/work/
6064
6165 # run npm
6266 npm :
@@ -66,5 +70,4 @@ services:
6670 environment : ["NPM_CONFIG_UPDATE_NOTIFIER=false"]
6771 entrypoint : " npm"
6872 volumes :
69- - ./web:/work
70- - ./.air/node_modules/:/work/node_modules/
73+ - ./../web:/work
0 commit comments