WeatherService/Dockerfile

28 lines
438 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' .
RUN ls -la
FROM alpine:latest
WORKDIR /
COPY --from=builder /src/weather .
RUN ls -la
RUN chmod +x ./weather
ENTRYPOINT ["/weather"]
EXPOSE 8080