Add Dockerfile
This commit is contained in:
40
Dockerfile
Normal file
40
Dockerfile
Normal 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/
|
||||||
@ -12,17 +12,23 @@ body {
|
|||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
align-items: 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;
|
background-color: #0c2738;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-family: Ubuntu,serif;
|
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 {
|
.nobr {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user