From 8fff379f544f213c2d1caf7970279026165bea9b Mon Sep 17 00:00:00 2001 From: Alie Date: Tue, 3 Dec 2024 12:53:03 +0100 Subject: [PATCH] refactor docker tests and build --- .cargo/config.toml | 2 +- .dockerignore | 35 ----------------------------------- Dockerfile | 25 ++++++++++++++++--------- compose.yaml | 24 +++++++++++------------- 4 files changed, 28 insertions(+), 58 deletions(-) delete mode 100644 .dockerignore diff --git a/.cargo/config.toml b/.cargo/config.toml index c9ca2d1..78c4f1c 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [alias] -t="test -- --test-threads=1" \ No newline at end of file +t = "test -- --test-threads=1 --nocapture" diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index c8c66cd..0000000 --- a/.dockerignore +++ /dev/null @@ -1,35 +0,0 @@ -# Include any files or directories that you don't want to be copied to your -# container here (e.g., local build artifacts, temporary files, etc.). -# -# For more help, visit the .dockerignore file reference guide at -# https://docs.docker.com/engine/reference/builder/#dockerignore-file - -**/.DS_Store -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/charts -**/docker-compose* -**/compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/secrets.dev.yaml -**/values.dev.yaml -/bin -/target -LICENSE -README.md -config.toml -mastodon-data.toml -*.yaml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e5d130b..940db82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,22 @@ # syntax=docker/dockerfile:1 -FROM rust:1.82.0-slim-bullseye AS build -WORKDIR /app -ARG APP_NAME=mastodon-image-uploader-bot - +FROM rust:1.82.0-slim-bullseye AS deps RUN apt update && apt install pkg-config openssl libssl-dev -y +WORKDIR /app +COPY src src +COPY Cargo.toml Cargo.toml +COPY Cargo.lock Cargo.lock -RUN --mount=type=bind,source=src,target=src \ - --mount=type=bind,source=Cargo.toml,target=Cargo.toml \ - --mount=type=bind,source=Cargo.lock,target=Cargo.lock \ - <