28 lines
454 B
Docker
28 lines
454 B
Docker
FROM golang:latest as builder
|
|
LABEL maintainer="Johannes Theiner <kontakt@joethei.xyz>"
|
|
|
|
COPY . /
|
|
WORKDIR /src
|
|
|
|
ENV GO111MODULE=on
|
|
ENV CGO_ENABLED=0
|
|
ENV GOOS=linux
|
|
ENV GOARCH=amd64
|
|
|
|
RUN go mod download
|
|
RUN cd server
|
|
RUN go mod download
|
|
RUN cd ..
|
|
|
|
RUN go build -a -tags netgo -ldflags '-w' -buildvcs=false .
|
|
RUN ls -la
|
|
|
|
FROM alpine:latest
|
|
WORKDIR /
|
|
COPY --from=builder /src/weather .
|
|
RUN ls -la
|
|
RUN chmod +x ./weather
|
|
|
|
ENTRYPOINT ["/weather"]
|
|
EXPOSE 8080
|