You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
751 B
30 lines
751 B
FROM rust:1.69-slim as build
|
|
|
|
# Install build dependencies
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends lsb-release apt-transport-https \
|
|
build-essential curl wget pkg-config libssl-dev
|
|
|
|
# Root of the project
|
|
WORKDIR /app
|
|
|
|
# retrieve the src dir
|
|
COPY . .
|
|
|
|
# Build failed when not using nightly though I don't know which crate is responsible
|
|
RUN rustup default nightly; cargo build --release
|
|
|
|
# prepare deployment image
|
|
FROM debian:stable-slim
|
|
|
|
# To accept tls/ssl certificates from thrid parties
|
|
RUN apt-get update && apt-get -y --no-install-recommends install ca-certificates libssl-dev && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /app/target/release/server /app/
|
|
|
|
ENV HOST=0.0.0.0
|
|
|
|
CMD ["./server"]
|