-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (32 loc) · 1.22 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
clean:
rm -rf tools/target/*
build-image:
docker build -t letsrest/build --no-cache --force-rm=true -f ./tools/build/build.Dockerfile .
cp-configs:
cp ./tools/prod-files/* ./tools/target/
cp-makefile:
cp Makefile ./tools/target
build-letsrest: build-image
docker run -v letsrest:/go/src -t letsrest/build make build
docker cp $(shell docker ps -q -n=1):/letsrest ./tools/letsrest
docker build -t letsrest --no-cache --force-rm=true -f ./tools/letsrest.Dockerfile tools
rm ./tools/letsrest
docker save -o ./tools/target/letsrest.img letsrest
build-frontend:
cp -r /Users/ilyatimofee/prog/js/letsrest-ui/build ./tools/target/frontend
cd ./tools/target ; tar -jcvf frontend.tar.bz2 frontend
rm -r ./tools/target/frontend
build: clean build-letsrest cp-configs cp-makefile build-frontend
upload:
rsync -ravezP ./tools/target/* -e ssh [email protected]:/home/ilyaufo/letsrest
prepare-run:
docker load -i letsrest.img
tar -jxvf frontend.tar.bz2
chown ilyaufo frontend
run: prepare-run
docker-compose -p letsrest -f prod.docker-compose.yml up -d --build
stop:
docker-compose -p letsrest -f prod.docker-compose.yml stop
# =====================
run-mongo:
docker run -p 27017:27017 --name mg-letsrest -d mongo:3.5.9