Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/danielkvist/hugo-terrassa-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielkvist <d94.zaragoza@gmail.com>2019-01-10 00:08:56 +0300
committerdanielkvist <d94.zaragoza@gmail.com>2019-01-10 00:08:56 +0300
commitbd482e4ae26576011a5a0243425f9964952670f0 (patch)
treeffe3657eee12f0e144cfd611ef387899c662e75f
parent73296091f29382e186c49ad7816da966ac5d1d90 (diff)
improve makefilev1.2
-rw-r--r--Dockerfile3
-rw-r--r--makefile28
-rwxr-xr-xusage.sh5
3 files changed, 25 insertions, 11 deletions
diff --git a/Dockerfile b/Dockerfile
index c632d2a..6f19a7d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,4 +2,5 @@ FROM nginx
LABEL maintainer="d94.zaragoza@gmail.com"
EXPOSE 80/tcp
EXPOSE 80/udp
-COPY /exampleSite/public/ /usr/share/nginx/html/ \ No newline at end of file
+ARG HUGO_SITE=exampleSite
+COPY /${HUGO_SITE}/public/ /usr/share/nginx/html/ \ No newline at end of file
diff --git a/makefile b/makefile
index 6babce0..0d990dd 100644
--- a/makefile
+++ b/makefile
@@ -1,12 +1,20 @@
-IMAGE_NAME=hugo-test
-PORT=80
+IMAGE_NAME=terrassa
+APP_NAME=terrassa
+IMAGE_PORT=80
+HOST_PORT=80
+HUGO_SITE=exampleSite
-# Hugo
-hugo-build:
- cd ./exampleSite && hugo
-
-# Docker
-docker-build:
- docker image build --no-cache -t $(IMAGE_NAME) .
+build:
+ cd ./$(HUGO_SITE) && hugo
+docker:
+ docker image build --build-arg HUGO_SITE=$(HUGO_SITE) -t $(IMAGE_NAME) .
+docker-nc:
+ docker image build --build-arg HUGO_SITE=$(HUGO_SITE) --no-cache -t $(IMAGE_NAME) .
run:
- docker container run -d -p $(PORT):80 $(IMAGE_NAME)
+ docker container run -d -p $(IMAGE_PORT):$(HOST_PORT) --name $(APP_NAME) $(IMAGE_NAME)
+stop:
+ docker container stop $(APP_NAME)
+rm:
+ docker container rm $(APP_NAME)
+clean:
+ docker container stop $(APP_NAME) && docker container rm $(APP_NAME) && docker image rm $(IMAGE_NAME) && cd ./$(HUGO_SITE) && rm -rf ./public
diff --git a/usage.sh b/usage.sh
new file mode 100755
index 0000000..23d8d60
--- /dev/null
+++ b/usage.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+make build
+make docker-nc
+make run \ No newline at end of file