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