-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (51 loc) · 1.88 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM rust:latest as builder
USER root
ENV TZ=Asia/Shanghai
COPY . /AuroraPlan
WORKDIR /AuroraPlan
RUN mkdir -p /$HOME/.cargo
RUN sed -i 's/rustc-wrapper = "sccache"/#rustc-wrapper = "sccache"/g' /AuroraPlan/.cargo/config.toml
RUN cp /AuroraPlan/.cargo/config.toml /$HOME/.cargo/config.toml
RUN cat /$HOME/.cargo/config.toml
RUN cat /AuroraPlan/.cargo/config.toml
RUN rm -rf /AuroraPlan/aurora-proto/build.rs
RUN ls -l /AuroraPlan/aurora-proto
ENV RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
ENV RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
ENV PATH="/root/.cargo/bin:$PATH"
RUN cargo install cargo-nextest
RUN cargo nextest run -F cn_msg --nocapture --release
RUN cargo build --release
RUN mkdir -p /AuroraPlan/deploy/examples
RUN mkdir -p /AuroraPlan/ui
RUN ls -la /AuroraPlan/target/release
RUN cp /AuroraPlan/target/release/aurora-api /AuroraPlan/deploy/
RUN cp /AuroraPlan/target/release/aurora-service /AuroraPlan/deploy/
RUN cp /AuroraPlan/target/release/migration /AuroraPlan/deploy/
RUN cp /AuroraPlan/target/release/aurora-tests-* /AuroraPlan/deploy/
RUN cp -r /AuroraPlan/target/release/examples /AuroraPlan/deploy/examples/
RUN ls -la /AuroraPlan/deploy/
RUN ls -la /AuroraPlan/deploy/examples
RUN cargo clean
RUN rm -rf /root/.cargo/registry/cache
FROM node:latest as node
USER root
ENV TZ=Asia/Shanghai
WORKDIR /AuroraPlan
COPY --from=builder /AuroraPlan .
RUN cd /AuroraPlan/aurora-ui && npm install && npm run build:prod
RUN ls -la /AuroraPlan/aurora-ui/dist
RUN cp -r /AuroraPlan/aurora-ui/dist/* /AuroraPlan/ui
FROM nginx:latest
USER root
ENV TZ=Asia/Shanghai
COPY --from=node /AuroraPlan/ui/* /usr/share/nginx/html
COPY ./ng-aurora-ui.conf /etc/nginx/conf.d/ng-aurora-ui.conf
FROM rust:latest
USER root
ENV TZ=Asia/Shanghai
WORKDIR /AuroraPlan
COPY --from=builder /AuroraPlan .
RUN ls -la /AuroraPlan/deploy/
RUN ls -la /AuroraPlan/deploy/examples
EXPOSE 8000