mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
2 years ago
|
services:
|
||
2 years ago
|
db:
|
||
|
image: mysql
|
||
|
volumes:
|
||
|
- ./.air/mysql:/var/lib/mysql
|
||
2 years ago
|
api:
|
||
2 years ago
|
image: cosmtrek/air
|
||
2 years ago
|
working_dir: /work
|
||
2 years ago
|
command: ["-c", "./scripts/.air.toml"]
|
||
2 years ago
|
environment:
|
||
|
- "MEMOS_DSN=root@tcp(db)/memos"
|
||
|
- "MEMOS_DRIVER=mysql"
|
||
2 years ago
|
volumes:
|
||
|
- .:/work/
|
||
2 years ago
|
- .air/go-build:/root/.cache/go-build
|
||
2 years ago
|
- $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host
|
||
2 years ago
|
web:
|
||
2 years ago
|
image: node:20-alpine
|
||
2 years ago
|
working_dir: /work
|
||
|
depends_on: ["api"]
|
||
|
ports: ["3001:3001"]
|
||
|
environment: ["DEV_PROXY_SERVER=http://api:8081/"]
|
||
2 years ago
|
entrypoint: ["/bin/sh", "-c"]
|
||
|
command: ["corepack enable && pnpm install && pnpm dev"]
|
||
2 years ago
|
volumes:
|
||
|
- ./web:/work
|
||
|
- ./.air/node_modules/:/work/node_modules/ # Cache for Node Modules
|
||
2 years ago
|
|
||
|
# Services below are used for developers to run once
|
||
|
#
|
||
|
# You can just run `docker compose run --rm SERVICE_NAME` to use
|
||
|
# For example:
|
||
|
# To regenerate typescript code of gRPC proto
|
||
|
# Just run `docker compose run --rm buf`
|
||
|
#
|
||
|
# All of theses services belongs to profile 'tools'
|
||
|
# This will prevent to launch by normally `docker compose up` unexpectly
|
||
|
|
||
|
# Generate typescript code of gRPC proto
|
||
|
buf:
|
||
|
profiles: ["tools"]
|
||
|
image: bufbuild/buf
|
||
|
working_dir: /work/proto
|
||
|
command: generate
|
||
|
volumes:
|
||
|
- ./proto:/work/proto
|
||
|
- ./web/src/types/:/work/web/src/types/
|
||
|
|
||
|
# Do golang static code check before create PR
|
||
|
golangci-lint:
|
||
|
profiles: ["tools"]
|
||
|
image: golangci/golangci-lint:v1.54.2
|
||
|
working_dir: /work/
|
||
2 years ago
|
entrypoint: golangci-lint
|
||
|
command: run -v
|
||
2 years ago
|
volumes:
|
||
|
- $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host
|
||
2 years ago
|
- .air/go-build:/root/.cache/go-build
|
||
2 years ago
|
- .:/work/
|
||
|
|
||
2 years ago
|
# run npm
|
||
|
npm:
|
||
2 years ago
|
profiles: ["tools"]
|
||
2 years ago
|
image: node:20-alpine
|
||
2 years ago
|
working_dir: /work
|
||
2 years ago
|
environment: ["NPM_CONFIG_UPDATE_NOTIFIER=false"]
|
||
|
entrypoint: "npm"
|
||
2 years ago
|
volumes:
|
||
|
- ./web:/work
|
||
|
- ./.air/node_modules/:/work/node_modules/
|