Dockerfile 1.21 KB
Newer Older
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
1
2
3
4
5
6
7
8
FROM golang:1.14 as builder
RUN adduser --system appuser

WORKDIR $GOPATH/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram
COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/app -a gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice

Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
9
10
11
12
13
14
15
16
17
FROM golang:1.14 as histogram_builder
RUN adduser --system appuser

WORKDIR $GOPATH/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram
COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/histogram -a gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/histogram


Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
18
19
20
FROM perl:5.30-slim-buster
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
21
COPY --from=builder /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram/bin/app /app
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
22
COPY --from=builder /etc/passwd /etc/passwd
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
23
COPY --from=histogram_builder /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram/bin/histogram /usr/bin
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
24
RUN chmod +x /usr/bin/histogram
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
25
26

RUN apt-get update && \
27
apt-get install -y exiftool ffmpeg imagemagick && \
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
28
29
apt-get autoremove -y && \
apt-get clean
30
31
32
# ADD ffprobe /usr/bin/
# ADD convert /usr/bin/
# ADD identify /usr/bin/
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
33
34
35

USER appuser

36
EXPOSE 8083
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
37
38

ENTRYPOINT ["/app/app"]