-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 855 Bytes
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 855 Bytes
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
###
FROM golang:alpine as builder
RUN apk add --no-cache git curl
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
WORKDIR /go/src/SLALite
COPY . .
RUN rm -rf vendor
#RUN dep ensure
RUN go get -d -v ./...
ARG VERSION
ARG DATE
RUN CGO_ENABLED=0 GOOS=linux go build -a -o SLALite -ldflags="-X main.version=${VERSION} -X main.date=${DATE}" .
###
FROM alpine:3.6
WORKDIR /opt/slalite
COPY --from=builder /go/src/SLALite/SLALite .
RUN mkdir /etc/slalite
COPY docker/slalite_prometheus.yml /etc/slalite/slalite.yml
COPY resources/templates resources/templates
# swaggerui
COPY ./swaggerui ./swaggerui
RUN addgroup -S slalite && adduser -D -G slalite slalite
RUN chown -R slalite:slalite /etc/slalite && chmod 700 /etc/slalite
EXPOSE 8090
#ENTRYPOINT ["./run_slalite.sh"]
USER slalite
ENTRYPOINT ["/opt/slalite/SLALite"]