aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-24 04:36:20 -0700
committerFuwn <[email protected]>2024-06-24 04:36:20 -0700
commita7d1406683e29358a269f0c10df572339eebcf5d (patch)
treee3d4e6f672ad38180cb031859fab9e343fbc319c /Dockerfile
parentfeat(technology): maths (diff)
downloadlocus-a7d1406683e29358a269f0c10df572339eebcf5d.tar.xz
locus-a7d1406683e29358a269f0c10df572339eebcf5d.zip
chore: add fly.io configuration
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..4cf5374
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,43 @@
+FROM clux/muslrust:nightly as dependencies
+
+RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
+
+FROM clux/muslrust:nightly as build
+
+WORKDIR /source
+
+RUN cargo new locus
+
+WORKDIR /source/locus
+
+COPY amenadiel/ ./amenadiel/
+COPY Cargo.* .
+
+RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
+RUN cargo build --release -Zbuild-std
+
+COPY .git .git
+COPY content content
+COPY src src
+COPY build.rs build.rs
+COPY yarte.toml yarte.toml
+
+RUN --mount=type=cache,target=/source/locus/target \
+ --mount=type=cache,target=/root/.cargo/registry \
+ cargo build --release --bin locus \
+ && strip -s /source/locus/target/x86_64-unknown-linux-musl/release/locus \
+ && mv /source/locus/target/x86_64-unknown-linux-musl/release/locus .
+
+FROM gcr.io/distroless/static:nonroot
+
+WORKDIR /locus
+
+COPY --from=build /source/locus/locus .
+COPY ./content ./content
+
+# CBA
+USER root
+
+EXPOSE 1965
+
+ENTRYPOINT ["./locus"]