Add a dockerfile which may or may not work
This commit is contained in:
parent
77a39f8b9f
commit
414ed530a9
|
@ -0,0 +1,7 @@
|
|||
target/debug
|
||||
target/rls
|
||||
target/release/build
|
||||
target/release/deps
|
||||
target/release/examples
|
||||
target/release/incremental
|
||||
node_modules/
|
|
@ -0,0 +1,29 @@
|
|||
# 1: Build the exe
|
||||
FROM rust:latest as builder
|
||||
WORKDIR /usr/ddv
|
||||
|
||||
# 1a: Prepare for static linking
|
||||
RUN apt-get update && \
|
||||
apt-get dist-upgrade -y && \
|
||||
apt-get install -y libssl-dev && \
|
||||
rustup toolchain add stable
|
||||
|
||||
# 1c: Build the exe using the actual source code
|
||||
COPY Cargo.toml .
|
||||
COPY src ./src
|
||||
RUN cargo build --release
|
||||
|
||||
# 2: Copy the exe and extra files ("static") to an empty Docker image
|
||||
FROM debian:10-slim
|
||||
COPY --from=builder /usr/ddv/target/release/dotdotvote .
|
||||
|
||||
COPY apidocs ./apidocs
|
||||
COPY views ./views
|
||||
COPY assets ./static
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get dist-upgrade -y && \
|
||||
apt-get install -y libssl-dev
|
||||
|
||||
USER 1000
|
||||
CMD ["./dotdotvote"]
|
|
@ -1,6 +1,6 @@
|
|||
<header class="masthead">
|
||||
<div class="inner">
|
||||
<h3 class="masthead-brand">Dot dot vote</h3>
|
||||
<h1 class="masthead-brand">Dot dot vote</h1>
|
||||
<nav class="nav nav-masthead justify-content-center">
|
||||
<a class="nav-link" href="/">Home</a>
|
||||
<a class="nav-link" href="/about">About</a>
|
||||
|
|
Loading…
Reference in New Issue