-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 905 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
PWD=$(shell pwd)
PORT := 8080
REGION := fr-par
IMAGE_NAME := spam_detection
VERSION := latest
REGISTRY_ENDPOINT := rg.$(REGION).scw.cloud
REGISTRY_NAMESPACE := osp-internal-tools
REGISTRY_TAG := $(REGISTRY_ENDPOINT)/$(REGISTRY_NAMESPACE)/$(IMAGE_NAME):$(VERSION)
AUTH_TOKEN := dummy
login:
docker login $(REGISTRY_ENDPOINT) -u userdoesnotmatter -p $(TOKEN)
push:
docker push $(REGISTRY_TAG)
deploy:
@make login
@make push
build:
docker build -t $(IMAGE_NAME) . --compress --tag $(REGISTRY_TAG)
run:
docker run -it -e AUTH_TOKEN=$(AUTH_TOKEN) -e PORT=$(PORT) -p $(PORT):$(PORT) --rm $(REGISTRY_TAG)
start:
@make build
@make run
bash:
docker run -it --mount type=bind,source=$$(pwd)/training,target=/spam_detection/training --rm $(REGISTRY_TAG) /bin/bash
train:
docker run -it --mount type=bind,source=$$(pwd)/training,target=/spam_detection/training --rm $(REGISTRY_TAG) python trainer.py