From 76d955a69a5ecabc5b6440dda7fa70425ce87900 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Fri, 27 Oct 2023 21:21:52 +0800 Subject: [PATCH] chore: docker compose dev (#2458) * add golang build cache volume to speedup build * replace `lint` with `npm` to run more scripts * wrap golangci-lint as entrypoint instead of command --- docker-compose.dev.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 5cc8de62..2c1e07d9 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -12,6 +12,7 @@ services: - "MEMOS_DRIVER=mysql" volumes: - .:/work/ + - .air/go-build:/root/.cache/go-build - $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host web: image: node:18-alpine @@ -50,17 +51,20 @@ services: profiles: ["tools"] image: golangci/golangci-lint:v1.54.2 working_dir: /work/ - command: golangci-lint run -v + entrypoint: golangci-lint + 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/ - # Do javascript lint before create PR - lint: + # run npm + npm: profiles: ["tools"] image: node:18-alpine working_dir: /work - command: npm --no-update-notifier run lint + environment: ["NPM_CONFIG_UPDATE_NOTIFIER=false"] + entrypoint: "npm" volumes: - ./web:/work - ./.air/node_modules/:/work/node_modules/