-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 933 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
VERSION ?= missing
container = uuid-server
image = viniciusban/uuid-server
.PHONY: help, build, dev, runimage, stop
help:
@echo 'Usage:'
@echo " Run container for development. Current source code (not image's) with auto-reload enabled."
@echo ' $$ make dev VERSION=1.0.0'
@echo ' Run container using image VERSION.'
@echo ' $$ make runimage VERSION=1.0.0'
@echo ' Stop'
@echo ' $$ make stop'
@echo ' Build image VERSION'
@echo ' $$ make build VERSION=1.1.0'
build:
@if [ "${VERSION}" = "missing" ]; then (echo "Missing VERSION"; exit 1); fi
docker image build --no-cache -t ${image}:${VERSION} .
dev:
docker container run --rm --name ${container} \
-p 8080:80 \
-v ${PWD}/app:/code/app \
${image}:${VERSION} \
fastapi run --reload app/main.py --port 80
runimage:
docker container run --rm --name ${container} \
-p 8080:80 \
${image}:${VERSION}
stop:
docker container stop ${container}