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
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
# Build with necessary params to enable statically linking openssl, glibc and sqlite3
|
||||
RUN nimble build --passL:-L/usr/lib \
|
||||
|
@ -16,10 +17,16 @@ RUN nimble build --passL:-L/usr/lib \
|
|||
--passl:-lcrypto \
|
||||
--passL:-static \
|
||||
-d:release \
|
||||
--opt:size
|
||||
--opt:size \
|
||||
--accept
|
||||
|
||||
# Our binary lives in this image
|
||||
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"]
|
||||
|
|
Loading…
Reference in a new issue