mirror of
https://github.com/oxynote/oxynote.git
synced 2026-10-17 02:49:18 +02:00
54 lines
1.6 KiB
Makefile
54 lines
1.6 KiB
Makefile
COMPOSE := docker-compose -p oxynote -f docker/docker-compose.dev.yaml
|
|
|
|
# backend containers + web dev server on the host with hot reload. Ctrl-c
|
|
# stops the web dev server; `make stop` stops the containers.
|
|
.PHONY: dev
|
|
dev: build-go sync-changedetection-key
|
|
$(COMPOSE) up --build -d
|
|
cd web && NUXT_PUBLIC_APP_BASE_URL=http://localhost:3000 pnpm run start:dev:web
|
|
|
|
# foreground: streams all logs, ctrl-c stops the stack
|
|
.PHONY: run
|
|
run: build-go sync-changedetection-key
|
|
$(COMPOSE) --profile web up --build
|
|
|
|
# background
|
|
.PHONY: start
|
|
start: build-go sync-changedetection-key
|
|
$(COMPOSE) --profile web up --build -d
|
|
|
|
.PHONY: stop
|
|
stop:
|
|
$(COMPOSE) --profile web down
|
|
|
|
.PHONY: setup
|
|
setup:
|
|
cd web && pnpm run setup
|
|
cd server/auth-realtime && pnpm install
|
|
cd server/core && go mod download
|
|
cd datagen && go mod download
|
|
for f in core auth-realtime web; do \
|
|
test -f docker/env/$$f.local.env || cp docker/env/$$f.example.env docker/env/$$f.local.env; \
|
|
done
|
|
test -f web/.env || cp docker/env/web.example.env web/.env
|
|
|
|
.PHONY: deps
|
|
deps:
|
|
cd web && pnpm run deps
|
|
cd server/auth-realtime && pnpm install
|
|
cd server/core && go mod download
|
|
cd datagen && go mod download
|
|
|
|
# goreleaser snapshot builds the go binaries + their :dev images
|
|
.PHONY: build-go
|
|
build-go:
|
|
cd server/core && make build
|
|
cd datagen && make build
|
|
|
|
# changedetection.io generates its API key on first boot; start it alone and
|
|
# copy the key into core.local.env before the rest of the stack (core reads
|
|
# its env only at container creation).
|
|
.PHONY: sync-changedetection-key
|
|
sync-changedetection-key:
|
|
$(COMPOSE) up -d changedetection
|
|
./docker/sync-changedetection-key.sh
|