-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (27 loc) · 822 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
FROM node:alpine as elm_builder
WORKDIR /usr/src/nihongo
COPY ./src ./src
COPY ./public ./public
COPY ./elm.json ./elm.json
COPY ./package.json ./package.json
COPY ./postcss.config.js ./postcss.config.js
COPY ./tailwind.config.js ./tailwind.config.js
COPY ./yarn.lock ./yarn.lock
RUN yarn
RUN yarn build:dist
FROM rust:buster as rust_builder
WORKDIR /usr/src
RUN USER=root cargo new --bin nihongo
WORKDIR /usr/src/nihongo
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
RUN cargo build --release
RUN rm ./target/release/deps/nihongo*
RUN rm src/*.rs
COPY ./src ./src
RUN cargo build --release
FROM debian:buster as runner
WORKDIR /usr/src/nihongo
COPY --from=rust_builder /usr/src/nihongo/target/release/nihongo ./nihongo
COPY --from=elm_builder /usr/src/nihongo/public ./public
CMD ./nihongo