Skip to content

Commit 673809e

Browse files
authored
fix: docker-compose.dev.yaml (usememos#2695)
* Fix docker-compose.dev.yaml * Add newline to .gitignore
1 parent f74fa97 commit 673809e

3 files changed

Lines changed: 19 additions & 12 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ build
1616
# Jetbrains
1717
.idea
1818

19+
# Docker Compose Environment File
20+
.env
21+
1922
bin/air
2023

21-
dev-dist
24+
dev-dist

scripts/docker-compose.dev.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
version: "3.0"
2+
name: memos-dev
13
services:
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

web/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2+
.pnpm-store
23
.DS_Store
34
dist
45
dist-ssr

0 commit comments

Comments
 (0)