So, for a bit of context, I dockerized / demonized a Hugo static website, and now I’m trying to make it run from the image.
If this is relevant at all, here is my Dockerfile:
FROM debian:stretch
RUN apt-get -qq update \
&& DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends git curl ca-certificates asciidoc \
&& rm -rf /var/lib/apt/lists/*
RUN curl --silent --show-error --fail --location \
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
"https://caddyserver.com/download/linux/amd64?plugins=http.expires,http.realip&license=personal" \
| tar --no-same-owner -C /usr/bin/ -xz caddy \
&& chmod 0755 /usr/bin/caddy \
&& /usr/bin/caddy -version \
ENV HUGO_VERSION 0.42.1
ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb
ADD https://github.com/gohugoio/hugo/releases/download/v0.42.2/hugo_0.42.2_Linux-64bit.deb /tmp/hugo.deb
RUN dpkg -i /tmp/hugo.deb \
&& rm /tmp/hugo.deb
COPY ./Caddyfile /etc/Caddyfile
COPY . /srv/app
WORKDIR /srv/app
RUN chown -R www-data:www-data /srv/app
RUN hugo
CMD ["/usr/bin/caddy", "--conf", "/etc/Caddyfile", "--log", "stdout"]
And here is my Caddyfile:
localhost
root /srv/app/public
According to this website, who told me that I didn’t need anything else
https://novelist.xyz/tech/caddy-webserver/
I can successfully build my image without any problem, and here is the output of Caddy:
Attaching to hugodelire_web_1
web_1 | Activating privacy features… done.
web_1 | http://localhost:2015
web_1 | 2018/06/30 10:30:21 http://localhost:2015
However, trying to reach “localhost”, “localhost:2015” or “localhost:8080” will either return “connection refused” or “connection reset”
What am I missing?
Thank you in advance