From 60b5a097b83eba9f30c78405bef9c0f30ee06ac2 Mon Sep 17 00:00:00 2001 From: Archit Sharma Date: Mon, 15 Apr 2024 13:23:20 +0530 Subject: [PATCH] new Dockerfile and make docker command added Signed-off-by: Archit Sharma --- Dockerfile | 15 ++++++++------- Makefile | 6 +++++- docker-compose.yaml | 10 ---------- 3 files changed, 13 insertions(+), 18 deletions(-) delete mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile index 574edbcf..8fbdb6d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -# Use floryn90/hugo:ext-alpine as the base image -FROM floryn90/hugo:ext-alpine +FROM razonyang/hugo:exts as builder -# Set the working directory to /src -WORKDIR /src +ARG HUGO_BASEURL= +ENV HUGO_BASEURL=${HUGO_BASEURL} -# Install Git and configure safe directory -RUN apk add --no-cache git && \ - git config --global --add safe.directory /src +COPY . /src +RUN hugo --minify --gc --enableGitInfo + +FROM razonyang/hugo:nginx +COPY --from=builder /src/public /site \ No newline at end of file diff --git a/Makefile b/Makefile index 45fd4495..d1f26bcc 100644 --- a/Makefile +++ b/Makefile @@ -41,4 +41,8 @@ clean: check-go: @echo "Checking if Go is installed..." @command -v go > /dev/null || (echo "Go is not installed. Please install it before proceeding."; exit 1) - @echo "Go is installed." \ No newline at end of file + @echo "Go is installed." + +docker: + docker build -t layer5/docs . + docker run -p 8080:80 layer5/docs \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index 8e671240..00000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3' - -services: - hugo: - image: floryn90/hugo:ext-alpine - ports: - - "1313:1313" - volumes: - - .:/src - command: server --buildDrafts --buildFuture --bind 0.0.0.0