-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (35 loc) · 982 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM node:15.8.0-alpine as node_builder
ARG VUE_APP_API_URL
ENV VUE_APP_API_URL=${VUE_APP_API_URL}
# update and install dependency
RUN apk update && apk upgrade
RUN apk add git
# copy the app, note .dockerignore
COPY . .
RUN yarn
# build necessary, even if no static files are needed,
# since it builds the server as well
RUN yarn build
FROM rust:1.50.0 as builder
RUN rustup default nightly-2021-08-17
COPY Cargo.toml .
COPY Rocket.toml .
COPY dummy.rs .
RUN cargo fetch # this should download dependencies
RUN sed -i 's#src/main.rs#dummy.rs#' Cargo.toml
RUN cargo build --release
RUN sed -i 's#dummy.rs#src/main.rs#' Cargo.toml
COPY src/ ./src/
RUN ["cargo", "build", "--release", "-Z", "unstable-options", "--out-dir", "output"]
FROM ubuntu
RUN apt-get update && apt-get upgrade -y && apt-get install openssl -y
COPY --from=node_builder \
dist \
/dist
COPY --from=builder \
output/nocode \
/
COPY --from=builder \
/Rocket.toml \
/
CMD /nocode