Skip to content

Commit

Permalink
fix: github action
Browse files Browse the repository at this point in the history
  • Loading branch information
yansongda committed Nov 6, 2023
1 parent 9651605 commit 46658ea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM rust:alpine AS builder
FROM rust:latest AS builder

WORKDIR /www

COPY ./ .

RUN apk add --no-cache musl-dev libressl-dev \
&& cargo build --release
RUN apt-get update \
&& update-ca-certificates \
&& apt-get install -y musl-tools libssl-dev \
&& rustup target add x86_64-unknown-linux-musl \
&& cargo build --target x86_64-unknown-linux-musl --release


FROM alpine:latest AS runtime
Expand All @@ -14,7 +17,7 @@ WORKDIR /www

ENV TZ=Asia/Shanghai

COPY --from=builder /www/target/release/miniprogram-api ./app
COPY --from=builder /www/target/x86_64-unknown-linux-musl/release/miniprogram-api ./app

RUN apk add -U --no-cache tzdata \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
Expand Down

0 comments on commit 46658ea

Please sign in to comment.