forked from Data-Infuser/Author
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (24 loc) · 706 Bytes
/
Makefile
File metadata and controls
32 lines (24 loc) · 706 Bytes
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
APP=author
CONTAINER=infuser-author
VERSION:=0.1
ENV:=dev #서비스 환경에 따라 dev, stage, prod로 구분
AUTHOR_PORT = 9090
NETWORK_OPTION=--publish $(AUTHOR_PORT):$(AUTHOR_PORT)
ifneq ($(OS),Windows_NT)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
NETWORK_OPTION=--network="host"
endif
ifeq ($(UNAME_S),Darwin)
NETWORK_OPTION=--publish $(AUTHOR_PORT):$(AUTHOR_PORT)
endif
endif
build:
go build ./main.go
docker-build:
docker build --tag $(CONTAINER):$(VERSION) --build-arg=AUTHOR_ENV=$(ENV) .
run-docker:
docker run --rm --detach $(NETWORK_OPTION) --name $(APP) $(CONTAINER):$(VERSION)
docker-log:
docker logs --follow $(APP)
.PHONY: build docker run-docker docker-log