Skip to content

Add basic Docker compatibility #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/samples
/*.log
*~
/data
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Builing Stage
ARG RUST_VERSION=1.80.1
FROM rust:${RUST_VERSION}-slim-bookworm AS build
WORKDIR /app

RUN --mount=type=bind,source=src,target=src \
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
<<EOF
set -e
cargo build --locked --release
cp target/release/bifrost /bifrost
EOF


# Final Stage
FROM debian:bookworm-slim AS final

COPY --from=build /bifrost /app/bifrost

WORKDIR /app

CMD ["/app/bifrost"]
14 changes: 14 additions & 0 deletions config.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bifrost:
cert_file: "certs/cert.pem"

bridge:
name: Bifrost
mac: 00:11:22:33:44:55
ipaddress: 10.12.0.20
netmask: 255.255.255.0
gateway: 10.12.0.1
timezone: Europe/Copenhagen

z2m:
server1:
url: ws://10.0.0.100:8080
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
bifrost:
build: .
volumes:
- /path/to/app-data/config.yaml:/app/config.yaml
- /path/to/app-data/certs:/app/certs
network_mode: host