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
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
RUN cargo build --release
|
RUN mkdir src
|
||||||
|
RUN echo "fn main() {}" > src/main.rs
|
||||||
|
|
||||||
FROM alpine:latest
|
RUN cargo build --release -Zsparse-registry
|
||||||
COPY --from=build /app/target/release/killjoy_turret /usr/local/bin/killjoy_turret
|
|
||||||
|
|
||||||
COPY ./config.json /app/config.json
|
COPY src ./src
|
||||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
|
||||||
|
|
||||||
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