50 lines
1.1 KiB
Docker
50 lines
1.1 KiB
Docker
# 打包命令
|
|
# docker buildx build -t zhushenwudi/lovelive-sif2:1.0.1 --platform=linux/amd64 .
|
|
# 使用适用于 Linux x86 的基础映像
|
|
# 保存镜像
|
|
# docker save -o lovelive-sif2.tar zhushenwudi/lovelive-sif2:1.0.1
|
|
|
|
FROM docker.io/library/debian:latest AS builder
|
|
|
|
# First - build
|
|
|
|
RUN apt update && apt install -y curl libssl-dev perl git gcc make
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash
|
|
RUN apt update && apt install -y nodejs
|
|
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain stable --profile minimal
|
|
|
|
WORKDIR /ew/
|
|
|
|
COPY ./ ./
|
|
|
|
RUN rm -f ./*.db
|
|
RUN rm -f ./*.lock
|
|
RUN rm -rf ./.idea
|
|
RUN rm -rf ./target
|
|
RUN rm -rf ./webui/node_modules
|
|
RUN rm -rf ./webui/dist
|
|
RUN rm -rf ./webui/*.lock
|
|
|
|
WORKDIR /ew/webui/
|
|
|
|
RUN npm i && npm run build
|
|
|
|
WORKDIR /ew/
|
|
|
|
RUN . "$HOME/.cargo/env" && cargo build --release --jobs=16
|
|
|
|
## Second - sort stuff idk
|
|
|
|
FROM docker.io/library/debian:bookworm-slim
|
|
|
|
RUN mkdir -p /root/ew/
|
|
COPY --from=builder /ew/target/release/ew /root/ew/ew
|
|
COPY ./docker/start.sh /root/ew/start.sh
|
|
|
|
RUN chmod +x /root/ew/start.sh
|
|
|
|
EXPOSE 8080
|
|
EXPOSE 8000
|
|
|
|
ENTRYPOINT ["/root/ew/start.sh"]
|