2023-09-29 12:56:35 +02:00
|
|
|
# --- build ---
|
|
|
|
FROM rust:alpine as builder
|
|
|
|
|
|
|
|
WORKDIR /opt/build
|
2023-10-31 15:46:54 +01:00
|
|
|
COPY filed .
|
|
|
|
COPY ./.git ./.git
|
2023-09-29 12:56:35 +02:00
|
|
|
|
2023-10-31 16:26:57 +01:00
|
|
|
RUN apk add --no-cache git musl-dev upx nodejs yarn && \
|
|
|
|
yarn global add uglify-js@3.17.4
|
2023-10-09 15:54:14 +02:00
|
|
|
|
2023-09-29 12:56:35 +02:00
|
|
|
RUN cargo b -r
|
2023-10-09 15:54:14 +02:00
|
|
|
RUN strip target/release/filed && upx --best target/release/filed
|
2023-09-29 12:56:35 +02:00
|
|
|
|
|
|
|
# --- deploy ---
|
2023-10-31 16:26:57 +01:00
|
|
|
FROM alpine:3.17
|
2023-09-29 12:56:35 +02:00
|
|
|
|
2023-10-22 16:03:02 +02:00
|
|
|
RUN mkdir /config
|
|
|
|
WORKDIR /config
|
|
|
|
|
2023-09-29 12:56:35 +02:00
|
|
|
COPY --from=builder /opt/build/target/release/filed /bin/filed
|
2023-09-29 12:58:13 +02:00
|
|
|
CMD [ "/bin/filed" ]
|