Skip to content

Commit 64e3e11

Browse files
Separate packages for core lib and server
1 parent af3c4c9 commit 64e3e11

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6082
-104
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target/
22
/.env
33
/node_modules/
4+
rust-toolchain.toml

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,3 @@ jobs:
4343
push: true
4444
tags: ${{ steps.meta.outputs.tags }}
4545
labels: ${{ steps.meta.outputs.labels }}
46-
cache-from: type=gha
47-
cache-to: type=gha,mode=max

Cargo.lock

Lines changed: 26 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,8 @@
1-
[package]
2-
name = "citadels"
3-
edition = "2021"
4-
default-run = "citadels"
5-
version = "0.7.1"
6-
7-
[[bin]]
8-
name = "citadels"
9-
path = "src/main.rs"
10-
11-
[dependencies]
12-
askama = { version = "0.12.1", default-features = false }
13-
axum = { version = "0.7.2", features = ["ws","macros"], default-features = true }
14-
axum-extra = { version = "0.9.0", features = ["cookie-private"], default-features = false }
15-
futures = { version = "0.3.30", default-features = false }
16-
http = { version = "1.0.0", default-features = false }
17-
rand = { version = "0.8.5", default-features = false }
18-
tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread"] }
19-
tokio-stream = { version = "0.1.14", default-features = false }
20-
tower = "0.4.13"
21-
tower-http = { version = "0.5.0", features = ["fs", "trace"] }
22-
log = "0.4.20"
23-
env_logger = { version = "0.10.1", features = ["color"] }
24-
rand_xoshiro = "0.6.0"
25-
rand_core = { version = "0.6.4", features = ["getrandom"] }
26-
serde = { version = "1.0.195", features = ["derive", "rc"] }
27-
serde_json = "1.0.111"
28-
time = "0.3.31"
29-
dotenv = { version = "0.15.0", optional = true }
30-
axum-core = "0.4.3"
31-
serde_with = "3.5.0"
32-
tracing = { version = "0.1.40", default-features = false }
33-
macros = { path = "./macros"}
34-
reqwest = { version = "0.12.4", features = ["json"], default-features = false }
35-
anyhow = { version = "1.0.83", default-features = true }
36-
maud = { version = "0.26.0", features = ["axum"], default-features = false}
37-
arcstr = { version = "1.2.0", features = ["serde"], default-features = false }
38-
uuid = { version = "1.8.0", features = ["v4"] }
39-
thiserror = "1.0.61"
40-
41-
[features]
42-
dev = []
43-
dotenv = ["dep:dotenv"]
44-
45-
# https://old.reddit.com/r/rust/comments/gvrgca/this_is_a_neat_trick_for_getting_good_runtime/
46-
[profile.dev.package."*"]
47-
opt-level = 3
48-
49-
[profile.dev]
50-
opt-level = 0
1+
[workspace]
2+
resolver = "2"
3+
members = [
4+
"citadels_server",
5+
"citadels",
6+
"macros",
7+
"macros-impl"
8+
]

Dockerfile

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# syntax=docker/dockerfile:1.3.1
22
# https://github.com/LukeMathWalker/cargo-chef?tab=readme-ov-file#without-the-pre-built-image
3-
FROM rust:alpine AS chef
4-
RUN apk add --no-cache musl-dev
5-
RUN cargo --version
6-
RUN cargo install cargo-chef
7-
3+
FROM lukemathwalker/cargo-chef:latest-rust-1.80.1 AS chef
84
WORKDIR /app
95

106
FROM chef AS planner
@@ -14,16 +10,15 @@ RUN cargo chef prepare --recipe-path recipe.json
1410
FROM chef AS builder
1511
COPY --from=planner /app/recipe.json recipe.json
1612

17-
COPY macros/ macros/
18-
COPY macros-impl/ macros-impl/
19-
13+
# build dependencies
2014
RUN cargo chef cook --release --recipe-path recipe.json
21-
# Build application
15+
16+
# build application
2217
COPY . .
23-
RUN cargo build --release --bin citadels
18+
RUN cargo build --release --bin citadels_server
2419

25-
FROM alpine AS runtime
20+
FROM debian:bookworm-slim AS runtime
2621
WORKDIR /app
27-
COPY --from=builder /app/target/release/citadels /usr/local/bin
22+
COPY --from=builder /app/target/release/citadels_server /usr/local/bin
2823
COPY public/ public/
29-
ENTRYPOINT ["/usr/local/bin/citadels"]
24+
ENTRYPOINT ["/usr/local/bin/citadels_server"]

citadels/Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
name = "citadels"
3+
edition = "2021"
4+
5+
6+
[dependencies]
7+
rand = { version = "0.8.5" }
8+
log = "0.4.20"
9+
env_logger = { version = "0.10.1", features = ["color"] }
10+
rand_xoshiro = "0.6.0"
11+
12+
rand_core = { version = "0.6.4", features = ["getrandom"] }
13+
serde = { version = "1.0.195", features = ["derive", "rc"] }
14+
serde_json = "1.0.111"
15+
time = "0.3.31"
16+
dotenv = { version = "0.15.0", optional = true }
17+
serde_with = "3.5.0"
18+
tracing = { version = "0.1.40", default-features = false }
19+
macros = { path = "../macros"}
20+
reqwest = { version = "0.12.4", features = ["json"], default-features = false }
21+
anyhow = { version = "1.0.83", default-features = true }
22+
maud = { version = "0.26.0", features = ["axum"], default-features = false}
23+
arcstr = { version = "1.2.0", features = ["serde"], default-features = false }
24+
uuid = { version = "1.8.0", features = ["v4"] }
25+
thiserror = "1.0.61"
26+
27+
[features]
28+
dev = []
29+
dotenv = ["dep:dotenv"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)