diff --git a/Cargo.toml b/Cargo.toml index b3a01ea..c1ac039 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ actix-rt = "2" actix-web-codegen-const-routes = { version = "0.1.0", tag = "0.1.0", git = "https://github.com/realaravinth/actix-web-codegen-const-routes" } argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"} sqlx = { version = "0.6.1", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "json"] } -clap = { vesrion = "3.2.20", features = ["derive"]} +clap = { version = "3.2.20", features = ["derive"]} config = "0.13" git2 = "0.14.2" diff --git a/Dockerfile b/Dockerfile index 34763d7..69385f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,21 @@ +FROM node:16.9.1 as frontend +COPY package.json package-lock.json /src/ +WORKDIR /src +RUN npm install +COPY . . +RUN npm run sass + FROM rust:slim as rust WORKDIR /src -RUN apt-get update && apt-get install -y git pkg-config libssl-dev +RUN apt-get update && apt-get install -y git pkg-config libssl-dev make RUN mkdir src && echo "fn main() {}" > src/main.rs COPY Cargo.toml . RUN sed -i '/.*build.rs.*/d' Cargo.toml COPY Cargo.lock . -RUN cargo build --release +RUN cargo build --release || true +COPY --from=frontend /src/static/ /src/static/ COPY . /src +RUN cd utils/cache-bust && cargo run RUN cargo build --release FROM debian:bullseye-slim