-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
40 lines (31 loc) · 1.01 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
# DOCKERFILE for the CCI-WEBSITE
# by Tim Müller
#
# Hosts the website in a Docker container for convenience.
#
FROM ubuntu:24.04
# Setup a dedicate user (for safetiez)
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN userdel -r ubuntu \
&& groupadd --gid $GROUP_ID hugo \
&& useradd -u $USER_ID -g $GROUP_ID hugo \
&& mkdir -p /home/hugo && chown -R hugo:hugo /home/hugo
# Install system deps
RUN apt-get update && apt-get install -y \
curl tar git gcc g++ \
&& rm -rf /var/lib/apt/lists/*
# Install GO
USER hugo
RUN /bin/bash -c 'curl -L https://go.dev/dl/go1.22.5.linux-amd64.tar.gz --output - | tar -C /home/hugo -xz'
ENV PATH="$PATH:/home/hugo/go/bin"
# ENV GOPATH="/home/hugo/go"
# Install Hugo from source
RUN CGO_ENABLED=1 go install -tags extended github.com/gohugoio/[email protected]
# Copy the website
COPY --chown=hugo:hugo . /www
# Install the required hugo modules
WORKDIR /www
RUN /bin/bash ./update_wowchemy.sh
# View the website upon container launch
ENTRYPOINT [ "hugo", "server", "--bind", "0.0.0.0" ]