19 lines
751 B
Docker
19 lines
751 B
Docker
# Build context is the `central/` dir (see docker-compose) so we can copy both
|
|
# server/ and db/ — the server embeds db/init.sql via include_str!("../../db/init.sql").
|
|
FROM rust:1-bookworm AS build
|
|
WORKDIR /build
|
|
COPY server/Cargo.toml server/Cargo.toml
|
|
COPY server/src server/src
|
|
COPY db db
|
|
WORKDIR /build/server
|
|
RUN cargo build --release
|
|
|
|
FROM debian:bookworm-slim
|
|
# nfs-common provides mount.nfs for `nfs`-kind projects (mounted on demand at sync/download time).
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates nfs-common \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=build /build/server/target/release/central-server /usr/local/bin/central-server
|
|
ENV BIND_ADDR=0.0.0.0:8080
|
|
EXPOSE 8080
|
|
CMD ["central-server"]
|