-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
33 lines (25 loc) · 850 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
33
# Build Step
FROM golang:latest AS builder
# Prerequisites
RUN mkdir -p $GOPATH/src/github.com/jplu/visual-search-backend
ADD . $GOPATH/src/github.com/jplu/visual-search-backend
WORKDIR $GOPATH/src/github.com/jplu/visual-search-backend
# Build
ARG build
ARG version
RUN GO111MODULE=on CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=${version} -X main.Build=${build}" -o /tmp/visual-search-backend
# Final Step
FROM alpine
# Base packages
RUN apk update && apk upgrade && apk add ca-certificates && update-ca-certificates
RUN apk add --update tzdata
RUN rm -rf /var/cache/apk/*
# Copy binary from build step
COPY --from=builder /tmp/visual-search-backend /home/
# Define timezone
ENV TZ=Europe/Paris
# Define the ENTRYPOINT
WORKDIR /home
ENTRYPOINT ./visual-search-backend
# Document that the service listens on port 8080.
EXPOSE 8080