-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (34 loc) · 1018 Bytes
/
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
################################################
##
## Makefile for Local development
##
################################################
SHELL := /bin/bash
IMG ?= egarchive/beacon
TARGET ?= 2.0
CONTAINER ?= beacon
.PHONY: build run exec down server
all: build run server
build:
docker build $(ARGS) -t $(IMG):$(TARGET) .
run: PORTS=-p 5050:5050
up: PORTS=-p 5050:8080
run: ENTRYPOINT=--entrypoint "/bin/sleep"
run: CMD=1000000000000
up run:
docker run -d --rm \
--name $(CONTAINER) \
$(PORTS) \
-v $(shell pwd)/deploy/conf.py:/beacon/beacon/conf.py \
-v $(shell pwd)/beacon:/beacon/beacon \
-v $(shell pwd)/ui/static:/beacon/static \
-v $(shell pwd)/ui/templates:/beacon/templates \
$(ENTRYPOINT) $(IMG):$(TARGET) $(CMD)
exec-root: D_USER=--user root
exec-root exec:
docker exec -it $(D_USER) $(CONTAINER) bash
server:
docker exec -it $(CONTAINER) python -m beacon
down:
-docker kill $(CONTAINER)
-docker rm $(CONTAINER)