feat: process static files when building docker img
This commit is contained in:
parent
ba85626969
commit
7a8808f95c
2 changed files with 12 additions and 3 deletions
|
@ -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" }
|
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"}
|
argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"}
|
||||||
sqlx = { version = "0.6.1", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "json"] }
|
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"
|
config = "0.13"
|
||||||
git2 = "0.14.2"
|
git2 = "0.14.2"
|
||||||
|
|
13
Dockerfile
13
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
|
FROM rust:slim as rust
|
||||||
WORKDIR /src
|
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
|
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||||
COPY Cargo.toml .
|
COPY Cargo.toml .
|
||||||
RUN sed -i '/.*build.rs.*/d' Cargo.toml
|
RUN sed -i '/.*build.rs.*/d' Cargo.toml
|
||||||
COPY Cargo.lock .
|
COPY Cargo.lock .
|
||||||
RUN cargo build --release
|
RUN cargo build --release || true
|
||||||
|
COPY --from=frontend /src/static/ /src/static/
|
||||||
COPY . /src
|
COPY . /src
|
||||||
|
RUN cd utils/cache-bust && cargo run
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
FROM debian:bullseye-slim
|
FROM debian:bullseye-slim
|
||||||
|
|
Loading…
Reference in a new issue