diff --git a/README.md b/README.md index 0be09835..a4f8024b 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,24 @@ - add clap - add auth middleware - add request logs + - CI for: - publish reconcile - cross-platform build server - run load test on server - build and publish plugin with openapi types - build docker image + +todo: enable +[workspace.lints.clippy] +single_call_fn = { level = "allow", priority = 1 } +absolute_paths = { level = "allow", priority = 1 } +arithmetic_side_effects = { level = "allow", priority = 1 } +similar_names = { level = "allow", priority = 1 } +self_named_module_files = { level = "allow", priority = 1 } +single_char_lifetime_names = { level = "allow", priority = 1 } +missing_docs_in_private_items = { level = "allow", priority = 1 } +question_mark_used = { level = "allow", priority = 1 } +implicit_return = { level = "allow", priority = 1 } +pedantic = { level = "warn", priority = 0 } +cargo = { level = "warn", priority = 0 } \ No newline at end of file diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 00000000..d8139a70 --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,3 @@ +target +Dockerfile +.dockerignore diff --git a/backend/Cargo.toml b/backend/Cargo.toml index f797468f..357ac58a 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -7,13 +7,6 @@ members = [ "sync_lib" ] -[workspace.lints.clippy] -single_call_fn = "allow" -missing_docs_in_private_items = "allow" -question_mark_used = "allow" -implicit_return = "allow" - - [workspace.dependencies] serde = { version = "1.0.214", default-features = false, features = ["derive"] } thiserror = { version = "1.0.66", default-features = false } @@ -25,3 +18,5 @@ anyhow = { version = "1.0.94", features = ["backtrace"] } codegen-units = 1 lto = true opt-level = 3 + +[workspace.lints.clippy] diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 00000000..8574f061 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,16 @@ +FROM rust:1.83 as builder + +WORKDIR /usr/src/backend + +RUN apt update && apt install -y musl-tools +RUN rustup target add x86_64-unknown-linux-musl + +COPY . . + +RUN cargo build --package sync_server --release --target x86_64-unknown-linux-musl + +FROM alpine:3.21.0 + +COPY --from=builder /usr/src/backend/target/x86_64-unknown-linux-musl/release/sync_server /app/sync_server + +ENTRYPOINT ["/app/sync_server"] diff --git a/backend/sync_lib/Cargo.toml b/backend/sync_lib/Cargo.toml index 15dc9617..4d749244 100644 --- a/backend/sync_lib/Cargo.toml +++ b/backend/sync_lib/Cargo.toml @@ -28,4 +28,4 @@ default = ["console_error_panic_hook"] wee_alloc = [] [lints] -workspace = true \ No newline at end of file +workspace = true