forked from security-union/videocall-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.actix
25 lines (18 loc) · 906 Bytes
/
Dockerfile.actix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM rust:1.70-slim-bullseye as development
RUN apt-get --yes update && apt-get --yes install curl git pkg-config libssl-dev
RUN curl https://github.com/amacneil/dbmate/releases/download/v2.4.0/dbmate-linux-amd64 -L -o /usr/bin/dbmate && chmod +x /usr/bin/dbmate
RUN cargo install cargo-watch
RUN rustup component add clippy-preview
RUN rustup component add rustfmt
FROM development as build
COPY . /app
WORKDIR /app/actix-api
RUN cargo build --release
FROM --platform=linux/amd64 debian:bullseye-slim as production
COPY --from=build /usr/bin/dbmate /usr/bin/dbmate
COPY --from=build /app/actix-api/target/release/websocket_server /usr/bin/websocket_server
COPY --from=build /app/actix-api/target/release/webtransport_server /usr/bin/webtransport_server
COPY --from=build /app/actix-api/startup.sh /usr/bin/startup.sh
COPY --from=build /app/dbmate /app/dbmate
STOPSIGNAL SIGINT
CMD [ "startup.sh" ]