-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-server
36 lines (24 loc) · 902 Bytes
/
Dockerfile-server
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
26
27
28
29
30
31
32
33
34
35
36
FROM --platform=${BUILDPLATFORM:-linux/amd64} tonistiigi/xx AS xx
FROM --platform=${BUILDPLATFORM:-linux/amd64} rust:alpine AS builder
COPY --from=xx / /
ARG BUILDPLATFORM
RUN apk add clang lld libcrypto3 libssl3 openssl-dev musl-dev
RUN update-ca-certificates
WORKDIR /roboscape_build
COPY . .
RUN cargo fetch
ARG TARGETPLATFORM
RUN xx-apk add --no-cache gcc libcrypto3 libssl3 openssl-dev musl-dev
RUN xx-clang --wrap
WORKDIR /roboscape_build/roboscapesim-server
RUN xx-cargo build --release
RUN mkdir /roboscape_release
RUN cp -r ../target/$(xx-cargo --print-target-triple)/release/roboscape* /roboscape_release/
FROM --platform=${TARGETPLATFORM:-linux/amd64} debian:bookworm-slim
RUN apt-get update
RUN apt-get install -y libssl-dev ca-certificates curl
RUN update-ca-certificates
WORKDIR /roboscape
COPY --from=builder /roboscape_release .
EXPOSE 3000
CMD [ "./roboscapesim-server" ]