mirror of
https://codeberg.org/icewind/shelve.git
synced 2026-06-03 20:14:08 +02:00
25 lines
No EOL
570 B
Docker
25 lines
No EOL
570 B
Docker
FROM rust AS build
|
|
|
|
RUN rustup target add x86_64-unknown-linux-musl
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
# Build with a dummy main to pre-build dependencies
|
|
RUN mkdir src && \
|
|
echo "fn main(){}" > src/main.rs && \
|
|
cargo build --release --target x86_64-unknown-linux-musl && \
|
|
rm -r src
|
|
|
|
COPY src/ ./src/
|
|
COPY templates/ ./templates/
|
|
|
|
RUN touch src/main.rs && cargo build --release --target x86_64-unknown-linux-musl
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=build /target/x86_64-unknown-linux-musl/release/shelve /
|
|
EXPOSE 80
|
|
ENV ROCKET_PORT=80
|
|
ENV ROCKET_ADDRESS=0.0.0.0
|
|
|
|
CMD ["/shelve"] |