From b5ff8da65c219802136c0c10455febd410d1f197 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 14 Sep 2024 14:22:01 +0700 Subject: [PATCH] [Change] use dockerfile instead of nixpacks --- Dockerfile | 28 ++++++++++++++++++++++++++++ nixpacks.toml | 5 ----- 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 Dockerfile delete mode 100644 nixpacks.toml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2ea6f39 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:latest + +ENV HUGO_VERSION=0.124.0 +ENV HUGO_ENVIRONMENT=production +ENV HUGO_ENV=production + +RUN apt-get update && apt-get install -y \ + wget \ + git \ + nodejs \ + npm \ + && rm -rf /var/lib/apt/lists/* + +RUN wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && dpkg -i /tmp/hugo.deb \ + && rm /tmp/hugo.deb + +RUN npm install -g sass + +WORKDIR /src + +COPY . . + +RUN [ -f package-lock.json ] && npm ci || echo "No package-lock.json found. Skipping npm ci." + +RUN hugo --gc --minify + +WORKDIR /src/public \ No newline at end of file diff --git a/nixpacks.toml b/nixpacks.toml deleted file mode 100644 index e07c9e8..0000000 --- a/nixpacks.toml +++ /dev/null @@ -1,5 +0,0 @@ -[phases.setup] -nixPkgs = ['hugo'] - -[phases.build] -cmds = ['hugo']