Skip to content

Commit d66c72d

Browse files
authored
Merge pull request #2 from ellwoodb/master
Add basic Docker compatibility (contributed by @ellwoodb)
2 parents be545bd + 04c622b commit d66c72d

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/samples
77
/*.log
88
*~
9+
/data

Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Builing Stage
2+
ARG RUST_VERSION=1.80.1
3+
FROM rust:${RUST_VERSION}-slim-bookworm AS build
4+
WORKDIR /app
5+
6+
RUN --mount=type=bind,source=src,target=src \
7+
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
8+
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
9+
<<EOF
10+
set -e
11+
cargo build --locked --release
12+
cp target/release/bifrost /bifrost
13+
EOF
14+
15+
16+
# Final Stage
17+
FROM debian:bookworm-slim AS final
18+
19+
COPY --from=build /bifrost /app/bifrost
20+
21+
WORKDIR /app
22+
23+
CMD ["/app/bifrost"]

config.example.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
bifrost:
2+
cert_file: "certs/cert.pem"
3+
4+
bridge:
5+
name: Bifrost
6+
mac: 00:11:22:33:44:55
7+
ipaddress: 10.12.0.20
8+
netmask: 255.255.255.0
9+
gateway: 10.12.0.1
10+
timezone: Europe/Copenhagen
11+
12+
z2m:
13+
server1:
14+
url: ws://10.0.0.100:8080

docker-compose.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
bifrost:
3+
build: .
4+
volumes:
5+
- /path/to/app-data/config.yaml:/app/config.yaml
6+
- /path/to/app-data/certs:/app/certs
7+
network_mode: host

0 commit comments

Comments
 (0)