Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker-compose.dev.yaml #2695

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ build
# Jetbrains
.idea

# Docker Compose Environment File
.env

bin/air

dev-dist
dev-dist
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a newline to the end of the file

25 changes: 14 additions & 11 deletions scripts/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
version: "3.0"
name: memos-dev
services:
db:
image: mysql
volumes:
- ./.air/mysql:/var/lib/mysql
- ./../.air/mysql:/var/lib/mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some env var related to setting the password is required.

MYSQL_DATABASE: memos
api:
image: cosmtrek/air
working_dir: /work
Expand All @@ -11,8 +16,8 @@ services:
- "MEMOS_DSN=root@tcp(db)/memos"
- "MEMOS_DRIVER=mysql"
volumes:
- .:/work/
- .air/go-build:/root/.cache/go-build
- ./..:/work/
- ./../.air/go-build:/root/.cache/go-build
- $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host
web:
image: node:20-alpine
Expand All @@ -23,8 +28,7 @@ services:
entrypoint: ["/bin/sh", "-c"]
command: ["corepack enable && pnpm install && pnpm dev"]
volumes:
- ./web:/work
- ./.air/node_modules/:/work/node_modules/ # Cache for Node Modules
- ./../web:/work

# Services below are used for developers to run once
#
Expand All @@ -43,8 +47,8 @@ services:
working_dir: /work/proto
command: generate
volumes:
- ./proto:/work/proto
- ./web/src/types/:/work/web/src/types/
- ./../proto:/work/proto
- ./../web/src/types/:/work/web/src/types/

# Do golang static code check before create PR
golangci-lint:
Expand All @@ -55,8 +59,8 @@ services:
command: run -v
volumes:
- $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host
- .air/go-build:/root/.cache/go-build
- .:/work/
- ./../.air/go-build:/root/.cache/go-build
- ./..:/work/

# run npm
npm:
Expand All @@ -66,5 +70,4 @@ services:
environment: ["NPM_CONFIG_UPDATE_NOTIFIER=false"]
entrypoint: "npm"
volumes:
- ./web:/work
- ./.air/node_modules/:/work/node_modules/
- ./../web:/work
1 change: 1 addition & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.pnpm-store
.DS_Store
dist
dist-ssr
Expand Down