8 Commits

Author SHA1 Message Date
Tuan-Dat Tran
414678befd Merge branch 'dev' 2025-02-07 00:44:54 +01:00
Tuan-Dat Tran
7fa831ca13 hopefully fixed dark mode now
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2025-02-07 00:43:17 +01:00
Tuan-Dat Tran
8f8c724f5f refactor(athome): Removed comments and did cargo fix
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2025-02-07 00:39:25 +01:00
Tuan-Dat Tran
01c3ceb76d feat(deploy): Set Dockerfile according to official dioxus docs
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2025-02-07 00:28:29 +01:00
Tuan-Dat Tran
5ce21498e5 feat(build): Updated build to version 0.4.0
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2025-02-07 00:18:01 +01:00
a54d1f3c3b Merge pull request 'dev' (#12) from dev into master
Reviewed-on: #12
2024-07-25 12:12:25 +02:00
Tuan-Dat Tran
081229d66a Merge branch 'dev' 2024-05-21 23:32:53 +02:00
837e19e111 Merge pull request 'Closes #2 and #5' (#7) from dev into master
Reviewed-on: #7
2024-05-21 23:00:22 +02:00
8 changed files with 248 additions and 206 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
**/target
**/dist
LICENSES
LICENSE
temp
README.md

374
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,33 @@
FROM rust:1.84.0 AS dioxus
RUN cargo install dioxus-cli@^0.6
FROM rust:1 AS chef
RUN cargo install cargo-chef
WORKDIR /app
FROM dioxus AS builder
WORKDIR /athome/
RUN apt-get update && apt install libwebkit2gtk-4.1-dev build-essential curl npm \
wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev -y\
&& rm -rf /var/lib/apt/lists/*
RUN npm install -D tailwindcss
COPY ./Cargo.toml ./Cargo.toml
COPY ./Dioxus.toml ./Dioxus.toml
COPY ./input.css ./input.css
COPY ./tailwind.config.js ./tailwind.config.js
COPY ./src/ ./src/
COPY ./assets/ ./assets/
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
# Install `dx`
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
RUN cargo binstall dioxus-cli --root /.cargo -y --force
ENV PATH="/.cargo/bin:$PATH"
# Create the final bundle folder. Bundle always executes in release mode with optimizations enabled
RUN dx bundle --platform web
FROM dioxus AS runner
WORKDIR /app/
COPY --from=builder /athome/target/dx/athome/release/web/ ./
CMD [ "./server" ]
FROM chef AS runtime
COPY --from=builder /app/target/dx/athome/release/web/ /usr/local/app
# set our port and make sure to listen for all connections
ENV PORT=8080
ENV IP=0.0.0.0
# expose the port 8080
EXPOSE 8080
WORKDIR /usr/local/app
ENTRYPOINT [ "/usr/local/app/server" ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,3 +1,6 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;
@custom-variant dark (&:where(.dark, .dark *));

View File

@@ -10,7 +10,7 @@ use header::Header;
pub fn Layout() -> Element {
rsx! {
div {
class: "flex flex-col min-h-screen",
class: "dark flex flex-col min-h-screen",
Header {},
Body {
Outlet::<Route> {},

View File

@@ -61,7 +61,6 @@ fn App() -> Element {
rsx! {
document::Link { rel: "stylesheet", href: asset!("./assets/tailwind.css") }
document::Link { rel: "icon", href: asset!("./assets/favicon.ico") }
// <link rel="icon" type="image/x-icon" href="/images/favicon.ico">
meta {
name: "description",
content: "Visit Tuan-Dat Tran's website for his CV, publications, projects, and consulting services. Connect for collaboration.",
@@ -81,22 +80,6 @@ fn App() -> Element {
}}
"
}
// meta {
// property: "og:title",
// content: "Tuan-Dat Trans Personal Website",
// }
// meta {
// property: "og:description",
// content: "Explore Tuan-Dat Tran's personal website featuring his CV, publications, projects, and consulting services. Get insights into his professional journey and connect for collaboration opportunities.",
// }
// meta {
// property: "og:image",
// content: "https://www.tudattr.dev/pictures/headshot.webp",
// }
// meta {
// property: "og:url",
// content: "https://tudattr.dev",
// }
div {
class: "bg-white dark:bg-gray-900 min-h-screen",
Router::<Route> {},

View File

@@ -1,7 +1,7 @@
use dioxus::prelude::*;
use dioxus_i18n::t;
use crate::components::{Bolding, UnderConstruction, H1, HR};
use crate::components::{Bolding, H1, HR};
#[component]
pub fn PublicationsProjects() -> Element {