-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
54 lines (44 loc) · 1.7 KB
/
Makefile
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
# Load environment variables from .env file
include .env
export
default: help
.PHONY: help
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
.PHONY: build
build: # Build docker image.
docker build -t bookmark:latest .
docker tag bookmark:latest bookmarkorg/bookmark:latest
.PHONY: prod
prod: # Run bookmark dockerized in prod mode. Dockerized Database and ArchiveboxServer
docker compose up
.PHONY: dev
dev: # Run bookmark locally in dev mode. Dockerized Database and ArchiveboxServer
OPENAI_API_KEY=$(OPENAI_API_KEY)
export OPENAI_API_KEY
BOOKMARK_ARCHIVE_DELAY=$(BOOKMARK_ARCHIVE_DELAY)
export BOOKMARK_ARCHIVE_DELAY
docker compose -f docker-compose-dev.yml up -d
BOOKMARK_ARCHIVEBOX_URL=http://localhost:5001/add \
BOOKMARK_NOSTR_CLIENT_URL=http://localhost:5005/links \
iex -S mix phx.server
docker compose stop
.PHONY: console-prod
console-prod: # Executes interactive console in production mode
docker exec -it bookmark-app /app/bin/bookmark remote
.PHONY: stop
stop: # Terminates the execution of all containers
docker compose down --remove-orphans
.PHONY: clean
clean: # Terminates the execution of all containers + delete volumes
docker compose down -v --remove-orphans
docker volume rm bookmark_db -f
rm -r priv/static/archive/*
.PHONY: push-image
push-image: # Push image to registry
docker tag bookmark:latest bookmarkorg/bookmark:latest
docker push bookmarkorg/bookmark:latest
.PHONY: pull-images
pull-images: # Pull images from registry
docker pull bookmarkorg/bookmark:latest
docker pull bookmarkorg/archivebox-server:latest