FROM docker.io/golang:1.16 AS build WORKDIR /app/gohttpserver ADD . /app/gohttpserver RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-X main.VERSION=docker' -o gohttpserver FROM docker.io/alpine:latest RUN mkdir -p /app/public VOLUME /app/public WORKDIR /app ADD assets ./assets COPY --from=build /app/gohttpserver/gohttpserver . EXPOSE 8000 ENTRYPOINT [ "/app/gohttpserver", "--root=/app/public" ] CMD []