FROM rustlang/rust:nightly as build
RUN USER=root cargo new --bin app
WORKDIR /app
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
COPY ./config .cargo/
RUN cargo build --release
RUN rm -rf src && rm -rf target
COPY ./src ./src
RUN cargo build --release
FROM debian:jessie-slim
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
RUN mkdir -p /data/logs && chmod 0755 /data/logs
WORKDIR /data/src
COPY --from=build /app/target/release/app .
COPY Rocket.toml .
EXPOSE 8080
CMD ["./app"]
1
共 1 条评论, 1 页
评论区
写评论nightly 的只能自己玩,不能拿到生产环境中去用啊