diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..32028cd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM rust:1.66.0-alpine3.17 +COPY ./flog /opt/flog +WORKDIR /opt/flog +VOLUME ["/opt/flog/html"] +VOLUME ["/opt/flog/templates"] +RUN apk add build-base make bash +RUN cargo build +EXPOSE 80 diff --git a/README.md b/README.md index 1127934..58b5bd5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # Flog A simple blog engine based on Flair and SSW. +# TODO +* Pass the directory location as environment vars +* A Dockerfile that works + ![](sshot.png) diff --git a/Cargo.lock b/flog/Cargo.lock similarity index 100% rename from Cargo.lock rename to flog/Cargo.lock diff --git a/Cargo.toml b/flog/Cargo.toml similarity index 86% rename from Cargo.toml rename to flog/Cargo.toml index e319b2f..228f7ec 100644 --- a/Cargo.toml +++ b/flog/Cargo.toml @@ -5,6 +5,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "flog" +path = "src/main.rs" + [dependencies] flair = { git = "https://gitea.squi.fr/Rust/flair.git" } ssw = { git = "https://gitea.squi.fr/Rust/ssw.git" } diff --git a/html/footer.html b/flog/html/footer.html similarity index 100% rename from html/footer.html rename to flog/html/footer.html diff --git a/html/header.html b/flog/html/header.html similarity index 100% rename from html/header.html rename to flog/html/header.html diff --git a/html/index.html b/flog/html/index.html similarity index 100% rename from html/index.html rename to flog/html/index.html diff --git a/html/main.css b/flog/html/main.css similarity index 100% rename from html/main.css rename to flog/html/main.css diff --git a/html/pages/1-firstpage.html b/flog/html/pages/1-firstpage.html similarity index 100% rename from html/pages/1-firstpage.html rename to flog/html/pages/1-firstpage.html diff --git a/html/pages/2-secondpage.html b/flog/html/pages/2-secondpage.html similarity index 100% rename from html/pages/2-secondpage.html rename to flog/html/pages/2-secondpage.html diff --git a/html/pages/3-A_very_different_page.html b/flog/html/pages/3-A_very_different_page.html similarity index 100% rename from html/pages/3-A_very_different_page.html rename to flog/html/pages/3-A_very_different_page.html diff --git a/html/pics/ferris.png b/flog/html/pics/ferris.png similarity index 100% rename from html/pics/ferris.png rename to flog/html/pics/ferris.png diff --git a/html/pics/happy-ferris.png b/flog/html/pics/happy-ferris.png similarity index 100% rename from html/pics/happy-ferris.png rename to flog/html/pics/happy-ferris.png diff --git a/src/main.rs b/flog/src/main.rs similarity index 97% rename from src/main.rs rename to flog/src/main.rs index 6c84ea4..33c0fed 100644 --- a/src/main.rs +++ b/flog/src/main.rs @@ -98,8 +98,8 @@ fn main() { //Web conf let webconf = WebsrvConfig { - nbr_of_threads: 3, - bind_addr: String::from("0.0.0.0:8080"), + nbr_of_threads: 10, + bind_addr: String::from("0.0.0.0:80"), root_folder: String::from("./html"), }; start_websrv(webconf); diff --git a/templates/index.html.ft b/flog/templates/index.html.ft similarity index 100% rename from templates/index.html.ft rename to flog/templates/index.html.ft diff --git a/templates/pages/1-firstpage.html.ft b/flog/templates/pages/1-firstpage.html.ft similarity index 100% rename from templates/pages/1-firstpage.html.ft rename to flog/templates/pages/1-firstpage.html.ft diff --git a/templates/pages/2-secondpage.html.ft b/flog/templates/pages/2-secondpage.html.ft similarity index 100% rename from templates/pages/2-secondpage.html.ft rename to flog/templates/pages/2-secondpage.html.ft diff --git a/templates/pages/3-A_very_different_page.html.ft b/flog/templates/pages/3-A_very_different_page.html.ft similarity index 100% rename from templates/pages/3-A_very_different_page.html.ft rename to flog/templates/pages/3-A_very_different_page.html.ft diff --git a/templates/pagetemplate.html.ft b/flog/templates/pagetemplate.html.ft similarity index 100% rename from templates/pagetemplate.html.ft rename to flog/templates/pagetemplate.html.ft