Skip to content

Instantly share code, notes, and snippets.

@apoorvmote
Last active February 22, 2021 03:30
Show Gist options
  • Save apoorvmote/4a3feacb0c56214c9d0c0e4d258c24fa to your computer and use it in GitHub Desktop.
Save apoorvmote/4a3feacb0c56214c9d0c0e4d258c24fa to your computer and use it in GitHub Desktop.
{
"runArgs": [
"-v", "/etc/localtime:/etc/localtime:ro",
"-v", "/etc/timezone:/etc/timezone:ro"
]
}
version: '3.8'
# same as
# docker run -p 80:1313 -v $PWD:/home/apoorvmote/website/ hugo
services:
hugo:
build: .
image: hugo:latest
volumes:
- .:/home/apoorvmote/website/
ports:
- '80:1313'
FROM ubuntu:20.04
RUN apt-get update && apt-get install wget git xz-utils -y
RUN mkdir -p /home/apoorvmote/website/
WORKDIR /home/apoorvmote/website/
EXPOSE 1313
ENV PATH="$PATH:/usr/local/lib/nodejs/bin:\$PATH"
ENV NODE_VERSION=14.15.1
RUN mkdir -p /usr/local/lib/nodejs/ && wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz && tar -xf node-v${NODE_VERSION}-linux-x64.tar.xz -C /usr/local/lib/nodejs/ --strip-components=1 && rm node-v${NODE_VERSION}-linux-x64.tar.xz
ENV HUGO_VERSION=0.79.0
RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb && dpkg -i hugo_extended_${HUGO_VERSION}_Linux-64bit.deb && rm hugo_extended_${HUGO_VERSION}_Linux-64bit.deb
CMD [ "hugo", "serve", "--bind=0.0.0.0" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment