diff options
| author | Melonai <einebeere@gmail.com> | 2020-06-13 03:49:25 +0200 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2020-06-13 03:49:25 +0200 |
| commit | 5539abe770da491087afcd7dd1ccba1bf8f60631 (patch) | |
| tree | f77fefde4b1c9af83df555af1258da3b25dabc13 | |
| parent | 85443434a6869fc6bae68d075595fb633fd74876 (diff) | |
| download | shorest-5539abe770da491087afcd7dd1ccba1bf8f60631.tar.zst shorest-5539abe770da491087afcd7dd1ccba1bf8f60631.zip | |
deployment using docker
| -rw-r--r-- | .dockerignore | 3 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | Dockerfile | 14 | ||||
| -rw-r--r-- | Procfile | 1 | ||||
| -rw-r--r-- | package.json | 7 | ||||
| -rw-r--r-- | src/main.rs | 3 | ||||
| -rw-r--r-- | yarn.lock | 4 |
7 files changed, 20 insertions, 14 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..af5f417 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +target +.idea +README.md diff --git a/Cargo.toml b/Cargo.toml index 998b3f4..08712d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,5 +19,5 @@ base64 = "0.12.0" url = "2.1.1" diesel = { version = "1.4.4", features = ["postgres", "r2d2"] } actix-files = "0.2.1" - +openssl = "*" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b9a177a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM ekidd/rust-musl-builder:latest AS rust +ADD --chown=rust:rust . ./ +RUN cargo build --release + +FROM node:alpine +RUN apk --no-cache add ca-certificates +COPY --from=rust \ + /home/rust/ \ + /main +WORKDIR /main/src +RUN cd ./client && yarn install && yarn build; +RUN mv ./target/x86_64-unknown-linux-musl/release/shorest ./shorest +CMD ./shorest + diff --git a/Procfile b/Procfile deleted file mode 100644 index eb2f708..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: ./target/release/shorest \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 654a0ad..0000000 --- a/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "shorest", - "version": "0.2.0", - "scripts": { - "postinstall": "yarn --cwd ./client/; yarn --cwd ./client/ build" - } -} diff --git a/src/main.rs b/src/main.rs index 6fb0073..6ca2fe3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ -#[macro_use] extern crate serde_derive; +extern crate openssl; #[macro_use] extern crate diesel; +#[macro_use] extern crate serde_derive; mod schema; use schema::links; diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index fb57ccd..0000000 --- a/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - |
