mirror of
https://github.com/Noratrieb/killjoy-turret.git
synced 2026-01-14 14:45:01 +01:00
proper docker
This commit is contained in:
parent
1a61e75817
commit
d5c4f1b213
1 changed files with 20 additions and 9 deletions
29
Dockerfile
29
Dockerfile
|
|
@ -1,14 +1,25 @@
|
|||
FROM rust:alpine3.15 as build
|
||||
FROM rust as build
|
||||
|
||||
RUN rustup toolchain install nightly
|
||||
RUN rustup default nightly
|
||||
|
||||
WORKDIR /app
|
||||
COPY . ./
|
||||
RUN cargo build --release
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src
|
||||
RUN echo "fn main() {}" > src/main.rs
|
||||
|
||||
FROM alpine:latest
|
||||
COPY --from=build /app/target/release/killjoy_turret /usr/local/bin/killjoy_turret
|
||||
RUN cargo build --release -Zsparse-registry
|
||||
|
||||
COPY ./config.json /app/config.json
|
||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
||||
COPY src ./src
|
||||
|
||||
ENV CONFIG_PATH=/app/config.json
|
||||
# now rebuild with the proper main
|
||||
RUN touch src/main.rs
|
||||
RUN cargo build --release -Zsparse-registry
|
||||
|
||||
ENTRYPOINT ["sh", "./entrypoint.sh"]
|
||||
FROM debian:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/target/release/killjoy_turret killjoy_turret
|
||||
|
||||
CMD ["/app/killjoy_turret"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue