Improve Dockerfile
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
c5f4b66d25
commit
0bd5a5eb40
1 changed files with 10 additions and 3 deletions
13
Dockerfile
13
Dockerfile
|
@ -1,8 +1,9 @@
|
||||||
FROM nimlang/nim:alpine
|
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
|
RUN apk update && apk add git build-base curl bash openssl openssl-dev openssl-libs-static sqlite-dev sqlite-static
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
# Build with necessary params to enable statically linking openssl, glibc and sqlite3
|
# Build with necessary params to enable statically linking openssl, glibc and sqlite3
|
||||||
RUN nimble build --passL:-L/usr/lib \
|
RUN nimble build --passL:-L/usr/lib \
|
||||||
|
@ -16,10 +17,16 @@ RUN nimble build --passL:-L/usr/lib \
|
||||||
--passl:-lcrypto \
|
--passl:-lcrypto \
|
||||||
--passL:-static \
|
--passL:-static \
|
||||||
-d:release \
|
-d:release \
|
||||||
--opt:size
|
--opt:size \
|
||||||
|
--accept
|
||||||
|
|
||||||
# Our binary lives in this image
|
# Our binary lives in this image
|
||||||
FROM gcr.io/distroless/base:latest
|
FROM gcr.io/distroless/base:latest
|
||||||
|
|
||||||
COPY --from=builder nim_censor_bot /
|
COPY --from=builder /app/nim_censor_bot /
|
||||||
|
|
||||||
|
ENV DB_HOST="/data/censordata.db"
|
||||||
|
|
||||||
|
VOLUME /data
|
||||||
|
|
||||||
CMD ["./nim_censor_bot"]
|
CMD ["./nim_censor_bot"]
|
||||||
|
|
Loading…
Reference in a new issue