Add dockerimage for server

This commit is contained in:
Andras Schmelczer 2024-12-18 22:37:13 +00:00
parent 2d5c91a5ef
commit a4d9ec16a1
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
5 changed files with 37 additions and 8 deletions

16
backend/Dockerfile Normal file
View file

@ -0,0 +1,16 @@
FROM rust:1.83 as builder
WORKDIR /usr/src/backend
RUN apt update && apt install -y musl-tools
RUN rustup target add x86_64-unknown-linux-musl
COPY . .
RUN cargo build --package sync_server --release --target x86_64-unknown-linux-musl
FROM alpine:3.21.0
COPY --from=builder /usr/src/backend/target/x86_64-unknown-linux-musl/release/sync_server /app/sync_server
ENTRYPOINT ["/app/sync_server"]