nim-censor-bot/Dockerfile

33 lines
894 B
Text
Raw Normal View History

FROM nimlang/nim:alpine as builder
RUN apk update && apk add git build-base curl bash openssl openssl-dev openssl-libs-static sqlite-dev sqlite-static
COPY . /app
WORKDIR /app
# Build with necessary params to enable statically linking openssl, glibc and sqlite3
RUN nimble build --passL:-L/usr/lib \
-d:ssl \
-p:. \
--dynlibOverride:ssl \
--dynlibOverride:crypto \
--dynlibOverride:sqlite3 \
--passl:-lssl \
--passl:-lsqlite3 \
--passl:-lcrypto \
--passL:-static \
-d:release \
--opt:size \
--accept
# Our binary lives in this image
FROM gcr.io/distroless/base:latest
COPY --from=builder /app/nim_censor_bot /
ENV DB_HOST="/data/censordata.db"
VOLUME /data
CMD ["./nim_censor_bot"]