From 8d8a92a0b5111211061c683f79c2416f52a1eaa4 Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Mon, 25 Oct 2021 21:02:33 -0400 Subject: [PATCH] Added Docker support --- web/Dockerfile | 10 ++++++++++ web/build-docker.sh | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 web/Dockerfile create mode 100755 web/build-docker.sh diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..98b407b --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,10 @@ +FROM rust:1.56-alpine3.13 AS builder +RUN apk update +RUN apk add musl-dev +ADD . . +WORKDIR web +RUN cargo build --target=x86_64-unknown-linux-musl --release + +FROM scratch +COPY --from=builder target/x86_64-unknown-linux-musl/release/pronouns_today_web / +CMD ["/pronouns_today_web"] diff --git a/web/build-docker.sh b/web/build-docker.sh new file mode 100755 index 0000000..61e2900 --- /dev/null +++ b/web/build-docker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker build .. -t 'pronouns_today_web' -f Dockerfile