FROM golang:1.17.3
LABEL maintainer="SkynetLabs <devs@siasky.net>"

ENV GOOS linux
ENV GOARCH amd64

ARG branch=main

WORKDIR /root

RUN git clone --single-branch --branch ${branch} https://github.com/SkynetLabs/malware-scanner.git && \
    cd malware-scanner && \
    go mod download && \
    make release

ENV SKYNET_DB_HOST="localhost"
ENV SKYNET_DB_PORT="27017"
ENV SKYNET_DB_USER="username"
ENV SKYNET_DB_PASS="password"
ENV CLAMAV_IP=127.0.0.1
ENV CLAMAV_PORT=3310

ENTRYPOINT ["malware-scanner"]