summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-03-24 23:13:52 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-03-25 00:57:55 +0100
commit2793ae353771d1e9f88381b01493836164023f4d (patch)
treedb28b46a4ff07ac5bcccfaa45bc4264c14c98242
parent35ea28801ed4473b5d74e24ddd3340abb1d12f57 (diff)
docker: fix dockerfile
-rw-r--r--.qovery.yml2
-rw-r--r--Cargo.lock40
-rw-r--r--Cargo.toml2
-rw-r--r--Dockerfile14
4 files changed, 48 insertions, 10 deletions
diff --git a/.qovery.yml b/.qovery.yml
index f18fa54..31d38d8 100644
--- a/.qovery.yml
+++ b/.qovery.yml
@@ -6,7 +6,7 @@ application:
databases:
- type: "POSTGRESQL"
name: "gico-api-pg-db"
- version: "11"
+ version: "12"
routers:
- name: "main-gico-api"
routes:
diff --git a/Cargo.lock b/Cargo.lock
index a36bfdd..d87a9ee 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -858,6 +858,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
+name = "foreign-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
+dependencies = [
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
+
+[[package]]
name = "form_urlencoded"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1032,6 +1047,7 @@ dependencies = [
"git2",
"hex",
"md-5",
+ "openssl",
"regex",
"serde 1.0.124",
"slog",
@@ -1521,12 +1537,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
+name = "openssl"
+version = "0.10.33"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a61075b62a23fef5a29815de7536d940aa35ce96d18ce0cc5076272db678a577"
+dependencies = [
+ "bitflags",
+ "cfg-if 1.0.0",
+ "foreign-types",
+ "libc",
+ "once_cell",
+ "openssl-sys",
+]
+
+[[package]]
name = "openssl-probe"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
[[package]]
+name = "openssl-src"
+version = "111.14.0+1.1.1j"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "055b569b5bd7e5462a1700f595c7c7d487691d73b5ce064176af7f9f0cbb80a9"
+dependencies = [
+ "cc",
+]
+
+[[package]]
name = "openssl-sys"
version = "0.9.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1535,6 +1574,7 @@ dependencies = [
"autocfg",
"cc",
"libc",
+ "openssl-src",
"pkg-config",
"vcpkg",
]
diff --git a/Cargo.toml b/Cargo.toml
index 01b1764..55886f3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,8 @@ authors = ["Santo Cariotti <santo@dcariotti.me>"]
edition = "2018"
[dependencies]
+openssl = { version = "0.10", features = ["vendored"] }
+
actix-rt = "1.0.0"
actix-web = "3.0.0"
actix-http = "1.0.1"
diff --git a/Dockerfile b/Dockerfile
index 7ae6bd5..1871dd5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,29 +1,25 @@
# build stage
FROM rust:latest as cargo-build
-RUN apt-get update && apt-get install musl-tools -y
+RUN apt-get update && apt-get install musl-tools libssl-dev build-essential -y
RUN rustup target add x86_64-unknown-linux-musl
WORKDIR /usr/src/app
COPY . .
-RUN RUSTFLAGS=-Clinker=musl-gcc cargo build --release
---target=x86_64-unknown-linux-musl
+RUN RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
-###################
-# final stage
FROM alpine:latest
RUN addgroup -g 1000 app
RUN adduser -D -s /bin/sh -u 1000 -G app app
WORKDIR /home/app/bin/
-COPY --from=cargo-build
-/usr/src/app/target/x86_64-unknown-linux-musl/release/gico-api .
+COPY --from=cargo-build /usr/src/app/target/x86_64-unknown-linux-musl/release/gico .
-RUN chown app:app gico-api
+RUN chown app:app gico
USER app
EXPOSE 9090
-CMD ["./gico-api"]
+CMD ["./gico"]