-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.harebell
More file actions
34 lines (26 loc) · 937 Bytes
/
Dockerfile.harebell
File metadata and controls
34 lines (26 loc) · 937 Bytes
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
# syntax=docker/dockerfile:1.7
FROM --platform=linux/amd64 rust:1.94
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
coinor-libcbc-dev \
protobuf-compiler \
libssl-dev \
libpq-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY backend/Cargo.toml ./
COPY backend/build.rs ./
COPY backend/src ./src
COPY backend/migrations ./migrations
COPY backend/diesel.toml ./
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
--mount=type=cache,target=/app/target,sharing=locked \
RUST_MIN_STACK=16777216 cargo build --profile pipeline --bin harebell \
&& mkdir -p /output /app/tiles \
&& cp ./target/pipeline/harebell /output/
WORKDIR /app
EXPOSE 8080
CMD ["/output/harebell", "serve", "--address", "0.0.0.0", "--port", "8080"]