Add Dockerfile

This commit is contained in:
2022-02-18 23:18:41 +01:00
parent e0d0bef292
commit 06e12c186a
2 changed files with 51 additions and 5 deletions

40
Dockerfile Normal file
View File

@ -0,0 +1,40 @@
##################
### BASE STAGE ###
##################
FROM rust:1.57 as base
# Install build dependencies
RUN cargo install --locked trunk strip_cargo_version
RUN rustup target add wasm32-unknown-unknown
WORKDIR /app
RUN mkdir frontend backend common
###########################
### STRIP-VERSION STAGE ###
###########################
FROM base AS strip-version
COPY Cargo.lock Cargo.toml ./
RUN strip_cargo_version
###################
### BUILD STAGE ###
###################
FROM base AS build
RUN cargo init --lib .
COPY --from=strip-version /app/Cargo.toml /app/Cargo.lock /app/
RUN cargo build --release --target wasm32-unknown-unknown
COPY . .
RUN trunk build --release
########################
### PRODUCTION STAGE ###
########################
FROM nginx:alpine
COPY --from=base /app/dist/* /usr/share/nginx/html/

View File

@ -12,17 +12,23 @@ body {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background-image: url(/images/background.svg);
background-repeat: no-repeat;
background-blend-mode: multiply;
background-size: 100vh;
background-position: top;
background-color: #0c2738;
color: #ffffff;
height: 100%;
font-family: Ubuntu,serif;
}
body::after {
display: absolute;
top: 0;
bottom: 100vh;
left: 0;
right: 100vw;
background-image: url(/images/background.svg);
background-repeat: no-repeat;
}
.nobr {
white-space: nowrap;
}