From 033928db6e08c41bc56f33787a36b6d371043aed Mon Sep 17 00:00:00 2001 From: DataHearth Date: Fri, 23 Jun 2023 17:01:33 +0200 Subject: [PATCH] add container image --- .dockerignore | 9 ++++++++- Dockerfile | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 796603f..00efceb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,9 @@ target -.env \ No newline at end of file +.env +Dockerfile +.gitignore +*.db +*.db.wal +.git* +.dockerignore +LICENSE \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 81edf75..1e052dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,19 @@ -FROM rust:1.69-alpine +FROM rust:1 as builder WORKDIR /app -COPY . . \ No newline at end of file +COPY . . + +RUN cargo build --release + +FROM gcr.io/distroless/cc + +COPY --from=builder /app/target/release/tech-bot /tech-bot + +ENV DB_PATH=/app/tech-bot.db + +WORKDIR /app + +VOLUME [ "/app" ] + +CMD [ "/tech-bot" ] \ No newline at end of file