summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2022-04-06 07:38:23 -0700
committerJesse Morgan <jesse@jesterpm.net>2022-04-06 07:38:23 -0700
commita34d968a08d6723968a5f1081d6bad0779875785 (patch)
treeec0a327ff99317021d7995e45ad9ef120121fc34 /Dockerfile
parent462e9cca1d021652972067de39ff0118ce5faa2b (diff)
Snapshot of progress post-christmasHEADmaster
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..c1354eb
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,26 @@
+# Based on https://alexbrand.dev/post/how-to-package-rust-applications-into-minimal-docker-containers/
+FROM rust:1.57.0 AS build
+
+MAINTAINER Jesse Morgan <jesse@jesterpm.net>
+
+WORKDIR /usr/src
+
+# Build the dependencies first
+# This should help repeated builds go faster.
+RUN USER=root cargo new flowerpot
+WORKDIR /usr/src/flowerpot
+COPY Cargo.toml Cargo.lock ./
+RUN cargo build --release
+
+# Copy the source and build the application.
+COPY src ./src
+RUN cargo install --path .
+
+# Now build the deployment image.
+FROM debian:stable-slim
+# RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y libssl1.1 ca-certificates sqlite3
+COPY --from=build /usr/local/cargo/bin/flowerpot .
+COPY www ./www
+USER 999
+CMD ["./flowerpot"]