1
0
Fork 0
mirror of https://codeberg.org/icewind/shelve.git synced 2026-06-03 12:04:09 +02:00
shelve/Dockerfile
2021-07-31 14:46:39 +02:00

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"]