Browse Source

config server docker

appflowy 3 năm trước cách đây
mục cha
commit
952ac1cd3c

+ 7 - 0
.dockerignore

@@ -0,0 +1,7 @@
+.env
+.dockerignore
+doc/
+scripts/
+rust-lib/target/
+backend/target/
+app_flowy/

+ 10 - 0
backend/.dockerignore

@@ -0,0 +1,10 @@
+.env
+.dockerignore
+spec.yaml
+target/
+deploy/
+tests/
+Dockerfile
+scripts/
+migrations/
+app_flowy/

+ 2 - 1
backend/Cargo.toml

@@ -42,7 +42,8 @@ features = [
     "postgres",
     "uuid",
     "chrono",
-    "migrate"
+    "migrate",
+    "offline",
 ]
 
 

+ 15 - 0
backend/Dockerfile

@@ -0,0 +1,15 @@
+# We use the latest Rust stable release as base image
+FROM rust:1.53.0
+# Let's switch our working directory to `app` (equivalent to `cd app`)
+# The `app` folder will be created for us by Docker in case it does not
+# exist already.
+WORKDIR /app
+# Copy all files from our working environment to our Docker image
+
+COPY . .
+# Let's build our binary!
+# We'll use the release profile to make it faaaast
+WORKDIR /app/backend
+RUN cargo build --release
+# When `docker run` is executed, launch the binary!
+ENTRYPOINT ["./target/release/backend"]

+ 4 - 1
backend/doc/database_setup.md

@@ -2,6 +2,7 @@
 
 
 ### Docker
+
 1. follow the [instructions](https://docs.docker.com/desktop/mac/install/) to install docker.
 2. open terminal and run: `docker pull postgres`
    
@@ -25,4 +26,6 @@ export DB_NAME=flowy
 export DB_PORT=5433
 ```
 
-![img_1.png](img_1.png)
+![img_1.png](img_1.png)
+
+[Docker command](https://docs.docker.com/engine/reference/commandline/builder_prune/)

+ 4 - 4
rust-lib/dart-ffi/Cargo.toml

@@ -7,11 +7,11 @@ edition = "2018"
 [lib]
 name = "dart_ffi"
 # this value will change depending on the target os
-# for iOS it would be `cdylib`
-# for Macos it would be `cdylib`
+# for iOS it would be `rlib`
+# for Macos it would be `rlib`
 # for android it would be `c-dylib`
-# default cdylib
-crate-type = ["cdylib"]
+# default rlib
+crate-type = ["rlib"]
 
 
 [dependencies]

+ 1 - 7
rust-lib/flowy-dispatch/src/errors/errors.rs

@@ -7,7 +7,7 @@ use bytes::Bytes;
 use dyn_clone::DynClone;
 use protobuf::ProtobufError;
 use serde::{Serialize, Serializer};
-use std::{fmt, option::NoneError};
+use std::fmt;
 use tokio::{sync::mpsc::error::SendError, task::JoinError};
 
 pub trait Error: fmt::Debug + DynClone + Send + Sync {
@@ -53,12 +53,6 @@ impl From<SendError<EventRequest>> for DispatchError {
     }
 }
 
-impl From<NoneError> for DispatchError {
-    fn from(s: NoneError) -> Self {
-        InternalError::UnexpectedNone(format!("Unexpected none: {:?}", s)).into()
-    }
-}
-
 impl From<String> for DispatchError {
     fn from(s: String) -> Self { InternalError::Other(s).into() }
 }

+ 0 - 2
rust-lib/flowy-dispatch/src/lib.rs

@@ -1,5 +1,3 @@
-#![feature(try_trait)]
-
 mod errors;
 mod module;
 mod request;