Dockerize app
parent
3e2ea02d62
commit
5dd4544360
@ -0,0 +1,3 @@
|
||||
target
|
||||
.git
|
||||
|
@ -0,0 +1,23 @@
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y rustc cargo libssl-dev pkg-config
|
||||
|
||||
WORKDIR /srv
|
||||
|
||||
# Build dependencies and cache them
|
||||
COPY Cargo.* ./
|
||||
RUN mkdir -p src && \
|
||||
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
|
||||
cargo build --release && \
|
||||
rm -r src && \
|
||||
rm target/release/deps/diplonat*
|
||||
|
||||
# Build final app
|
||||
COPY ./src ./src
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
RUN apt-get update && apt-get install -y libssl1.1
|
||||
COPY --from=builder /srv/target/release/diplonat /usr/local/sbin/diplonat
|
||||
CMD ["/usr/local/sbin/diplonat"]
|
@ -0,0 +1,14 @@
|
||||
version: '3.4'
|
||||
services:
|
||||
diplonat:
|
||||
build: .
|
||||
image: superboum/amd64_diplonat:v1
|
||||
network_mode: host # required by UPNP/IGD
|
||||
environment:
|
||||
DIPLONAT_PRIVATE_IP: 192.168.0.18
|
||||
DIPLONAT_REFRESH_TIME: 60
|
||||
DIPLONAT_EXPIRATION_TIME: 300
|
||||
DIPLONAT_CONSUL_NODE_NAME: lheureduthe
|
||||
RUST_LOG: debug
|
||||
|
||||
|
Loading…
Reference in New Issue