-
Notifications
You must be signed in to change notification settings - Fork 75
/
Debian_Dockerfile
41 lines (32 loc) · 1.12 KB
/
Debian_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
# docker build -t wolweb .
FROM golang:1.20-buster AS builder
LABEL org.label-schema.vcs-url="https://github.com/sameerdhoot/wolweb" \
org.label-schema.url="https://github.com/sameerdhoot/wolweb/blob/master/README.md"
RUN mkdir /wolweb
WORKDIR /wolweb
# Install Dependecies
RUN git clone https://github.com/sameerdhoot/wolweb . && \
go mod tidy && \
go mod download
# Build Source Files
RUN go build -o wolweb .
# Create 2nd Stage final image
FROM debian
WORKDIR /wolweb
COPY --from=builder /wolweb/index.html .
COPY --from=builder /wolweb/wolweb .
COPY --from=builder /wolweb/devices.json .
COPY --from=builder /wolweb/config.json .
COPY --from=builder /wolweb/static ./static
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
ARG WOLWEBPORT=8089
ARG WOLWEBVDIR=/wolweb
ENV WOLWEBPORT=${WOLWEBPORT}
ENV WOLWEBVDIR=${WOLWEBVDIR}
CMD ["/wolweb/wolweb"]
EXPOSE ${WOLWEBPORT}
HEALTHCHECK --interval=5s --timeout=3s \
CMD curl --silent --show-error --fail http://localhost:${WOLWEBPORT}/${WOLWEBVDIR}/health || exit 1