forked from tdh8316/Investigo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (41 loc) · 1.81 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM golang:1.13-alpine AS builder
# Copy source code
COPY . /go/src/github.com/tdh8316/Investigo
WORKDIR /go/src/github.com/tdh8316/Investigo
# Build executable
RUN cd /go/src/github.com/tdh8316/Investigo \
&& go install \
&& ls -l /go/bin
FROM alpine:3.11 AS runtime
ARG TINI_VERSION=${TINI_VERSION:-"0.18.0"}
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.description="Investigo is a minimal Go implementation of Sherlock allowing to find usernames across social media." \
org.label-schema.name="investigo" \
org.label-schema.schema-version="1.0.0-rc1" \
org.label-schema.usage="https://github.com/tdh8316/Investigo/blob/master/README.md" \
org.label-schema.vcs-url="https://github.com/tdh8316/Investigo" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vendor="x0rzkov" \
org.label-schema.version="latest"
# Install tini to /usr/local/sbin
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-muslc-amd64 /usr/local/sbin/tini
# Install runtime dependencies & create runtime user
RUN apk --no-cache --no-progress add ca-certificates bash nano \
&& chmod +x /usr/local/sbin/tini && mkdir -p /opt \
&& adduser -D investigo -h /opt/investigo -s /bin/sh \
&& su investigo -c 'cd /opt/investigo; mkdir -p bin config data'
# Switch to user context
USER investigo
WORKDIR /opt/investigo
# Copy investigo binary to /opt/investigo/bin
COPY --from=builder /go/bin/Investigo /opt/investigo/bin/investigo
COPY config.example.yaml /opt/investigo/config/config.yaml
COPY data.json /opt/investigo/bin/data.json
ENV PATH $PATH:/opt/investigo/bin
# Container configuration
RUN echo ${PATH}
VOLUME ["/opt/investigo/data", "/opt/investigo/data/screenshots"]
ENTRYPOINT ["tini", "-g", "--"]
CMD ["/opt/investigo/bin/investigo"]