-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (46 loc) · 1.83 KB
/
Copy pathMakefile
File metadata and controls
57 lines (46 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Include variables
include .env.dist
-include .env
export
.PHONY: build
build:
docker buildx build --platform ${DOCKER_PLATFORM} --build-arg MEM0_VERSION=${MEM0_VERSION} -t ${DOCKER_SERVER_IMAGE} -t ${DOCKER_SERVER_IMAGE}-${MEM0_VERSION} .
docker buildx build --platform ${DOCKER_PLATFORM} --build-arg MEM0_VERSION=${MEM0_VERSION} -t ${DOCKER_DASHBOARD_IMAGE} -t ${DOCKER_DASHBOARD_IMAGE}-${MEM0_VERSION} dashboard
.PHONY: push
push:
docker push ${DOCKER_SERVER_IMAGE}
docker push ${DOCKER_SERVER_IMAGE}-${MEM0_VERSION}
docker push ${DOCKER_DASHBOARD_IMAGE}
docker push ${DOCKER_DASHBOARD_IMAGE}-${MEM0_VERSION}
.PHONY: up
up:
docker compose up
.PHONY: down
down:
docker compose down
.PHONY: clean
clean:
docker compose down
rm -rf .docker
.PHONY: logs
logs:
docker compose logs -f
.PHONY: enter
enter:
docker compose exec mem0 bash
.PHONY: health
health:
@echo "API: $$(curl -s -o /dev/null -w '%{http_code}' http://localhost:${MEM0_PORT}/docs)"
@echo "Dashboard: $$(curl -s -o /dev/null -w '%{http_code}' http://localhost:${DASHBOARD_PORT}/api/health)"
@echo "Postgres: $$(docker compose exec -T postgres pg_isready -q && echo 'ok' || echo 'down')"
.PHONY: test
test: _testcase-server _testcase-dashboard
.PHONY: _testcase-server
_testcase-server:
docker run --rm --platform ${DOCKER_PLATFORM} ${DOCKER_SERVER_IMAGE} python -c "import fastapi, uvicorn, alembic, mem0; print('mem0', mem0.__version__)"
docker run --rm --platform ${DOCKER_PLATFORM} ${DOCKER_SERVER_IMAGE} test -f /app/main.py
docker run --rm --platform ${DOCKER_PLATFORM} ${DOCKER_SERVER_IMAGE} alembic --version
.PHONY: _testcase-dashboard
_testcase-dashboard:
docker run --rm --platform ${DOCKER_PLATFORM} --entrypoint node ${DOCKER_DASHBOARD_IMAGE} --version
docker run --rm --platform ${DOCKER_PLATFORM} --entrypoint test ${DOCKER_DASHBOARD_IMAGE} -f /app/server.js