aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2021-05-15 14:18:59 +0200
committerMax Audron <audron@cocaine.farm>2021-05-15 14:18:59 +0200
commit5340979d23da14a98dce7210a5f00821c62ff8f1 (patch)
tree9da032925d3feadfe521a566637910a70549152d
parentadd config file (diff)
add container build
-rw-r--r--.gitlab-ci.yml3
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml4
-rw-r--r--Containerfile26
4 files changed, 35 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..c01da3f
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,3 @@
+include:
+ - project: "cocainefarm/templates/ci"
+ file: "/container.tags.yaml"
diff --git a/Cargo.lock b/Cargo.lock
index f299a92..dcfd2d9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -353,6 +353,8 @@ dependencies = [
[[package]]
name = "irc"
version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5510c4c4631e53c57d6b05c44ab8447d1db6beef28fb9d12c4d6a46fad9dfcc"
dependencies = [
"chrono",
"encoding",
@@ -375,6 +377,8 @@ dependencies = [
[[package]]
name = "irc-proto"
version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "55fa0a52d825e59ba8aea5b7503890245aea000f77e68d9b1903f3491fa33643"
dependencies = [
"bytes",
"encoding",
diff --git a/Cargo.toml b/Cargo.toml
index acce7b1..85bd957 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,8 +7,8 @@ edition = "2018"
[dependencies]
macros = { path = "./macros" }
-irc = { path = "/home/audron/repo/github.com/maxaudron/irc", version = "0.15", features = ["json", "tls-rust"], default_features = false }
-irc-proto = { path = "/home/audron/repo/github.com/maxaudron/irc/irc-proto" }
+irc = { version = "0.15", features = ["json", "tls-rust"], default_features = false }
+irc-proto = "0.15"
sasl = "0.5"
base64 = "0.13"
diff --git a/Containerfile b/Containerfile
new file mode 100644
index 0000000..30802e3
--- /dev/null
+++ b/Containerfile
@@ -0,0 +1,26 @@
+# ------------------------------------------------------------------------------
+# Cargo Build Stage
+# ------------------------------------------------------------------------------
+
+FROM docker.io/rust:1.52-alpine as cargo-build
+
+RUN rustup default nightly && rustup update
+
+WORKDIR /work
+
+COPY . .
+
+RUN apk add --no-cache musl-dev
+RUN cargo build --release
+
+# ------------------------------------------------------------------------------
+# Final Stage
+# ------------------------------------------------------------------------------
+
+FROM alpine:3.13
+
+COPY --from=cargo-build /work/target/release/catinator /usr/local/bin
+
+ENV CATINATOR_CONFIG="/config.toml"
+
+CMD ["/usr/local/bin/catinator"]