forked from daBONDi/go-rest-wol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (24 loc) · 780 Bytes
/
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
FROM golang:alpine AS builder
LABEL org.label-schema.vcs-url="https://github.com/daBONDi/go-rest-wol" \
org.label-schema.url="https://github.com/daBONDi/go-rest-wol/blob/master/README.md"
RUN mkdir /app
ADD . /app/
WORKDIR /app
# Install Dependecies
RUN apk update && apk upgrade && \
apk add --no-cache git && \
go get -d github.com/gorilla/handlers && \
go get -d github.com/gorilla/mux && \
go get -d github.com/gocarina/gocsv
# Build Source Files
RUN go build -o main .
# Create 2nd Stage final image
FROM alpine
WORKDIR /app
COPY --from=builder /app/pages/index.html ./pages/index.html
COPY --from=builder /app/computer.csv .
COPY --from=builder /app/main .
ARG WOLHTTPPORT=8080
ARG WOLFILE=computer.csv
CMD ["/app/main"]
EXPOSE ${WOLHTTPPORT}