Dockerfile 779 Bytes
Newer Older
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
1
FROM golang:1.14 as builder
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
2
RUN useradd -m appuser
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
3
4
5
6
7
8
9
10
11

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

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
12
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
13
14
15
COPY --from=builder /etc/passwd /etc/passwd

RUN apt-get update && \
16
apt-get install -y exiftool ffmpeg imagemagick && \
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
17
18
apt-get autoremove -y && \
apt-get clean
19
20
21
# ADD ffprobe /usr/bin/
# ADD convert /usr/bin/
# ADD identify /usr/bin/
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
22
23
24

USER appuser

25
EXPOSE 8083
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
26
27

ENTRYPOINT ["/app/app"]