-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
executable file
·43 lines (31 loc) · 1.06 KB
/
Dockerfile
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
# GitHub: https://github.com/neohugo/neohugo
# Website: https://neohugo.github.io/
FROM golang:1.21-alpine AS build
# Optionally set HUGO_BUILD_TAGS to "extended" or "nodeploy" when building like so:
# docker build --build-arg HUGO_BUILD_TAGS=extended .
ENV HUGO_BUILD_TAGS=extended
ARG CGO=1
ENV CGO_ENABLED=${CGO}
ENV GOOS=linux
ENV GO111MODULE=on
WORKDIR /go/src/github.com/neohugo/neohugo
COPY . /go/src/github.com/neohugo/neohugo/
# gcc/g++ are required to build SASS libraries for extended version
RUN apk update && \
apk add --no-cache gcc g++ musl-dev git && \
go install github.com/magefile/mage@latest
RUN mage neohugo && mage install
# ---
FROM alpine:3.18
COPY --from=build /go/bin/neohugo /usr/bin/neohugo
# libc6-compat & libstdc++ are required for extended SASS libraries
# ca-certificates are required to fetch outside resources (like Twitter oEmbeds)
RUN apk update && \
apk add --no-cache \
ca-certificates \
libc6-compat \
libstdc++ \
&& neohugo version
WORKDIR /src
# Expose port for live server
EXPOSE 1313