]> Untitled Git - lemmy.git/commitdiff
build: Improve server compile time with cache
authorFelix Pojtinger <felix@pojtinger.com>
Sat, 27 Apr 2019 08:51:08 +0000 (10:51 +0200)
committerFelix Pojtinger <felix@pojtinger.com>
Sat, 27 Apr 2019 08:51:08 +0000 (10:51 +0200)
README.md
server/Dockerfile.dev
skaffold.yaml

index cdd8c34c7a3c74f2e23260b4600af0c4995c5d65..8e3db3857fd266a61719a2d86c46fab2c8196b47 100644 (file)
--- a/README.md
+++ b/README.md
 
 A link aggregator / reddit clone for the fediverse.
 
-[Lemmy Dev instance](https://dev.lemmy.ml) _for testing purposes only_
+[Lemmy Dev instance](https://dev.lemmy.ml) *for testing purposes only*
 
 This is a **very early beta version**, and a lot of features are currently broken or in active development, such as federation.
 
-| Front Page                                      | Post                                            |
-| ----------------------------------------------- | ----------------------------------------------- |
-| ![main screen](https://i.imgur.com/y64BtXC.png) | ![chat screen](https://i.imgur.com/vsOr87q.png) |
+|Front Page|Post|
+|-----------------------------------------------|----------------------------------------------- |
+|![main screen](https://i.imgur.com/y64BtXC.png)|![chat screen](https://i.imgur.com/vsOr87q.png) |
 
 ## Features
 
index 3a6f927897f7db21f9ec5f8b8e852360655e2a99..c7951ce845299a08fef78d18e944e49b47581511 100644 (file)
@@ -1,6 +1,6 @@
 # Setup env
 FROM rust:1.33
-RUN mkdir -p /opt/lemmy/server--dev
+RUN USER=root cargo new --bin /opt/lemmy/server--dev
 WORKDIR /opt/lemmy/server--dev
 # Create empty directory where the frontend would normally be
 RUN mkdir -p /opt/lemmy/ui--dev/dist
@@ -10,8 +10,12 @@ RUN echo 'fn main() { println!("Dummy") }' >src/bin/main.rs
 # Install deps
 COPY Cargo.toml .
 COPY Cargo.lock .
-RUN cargo build
+RUN cargo build --release
+RUN rm src/bin/main.rs
 # Add app
-COPY . .
+COPY src/ src/
+COPY migrations/ migrations/
+RUN rm target/release/deps/lemmy*
+RUN cargo build --release
 # Run app
-CMD cargo run
+CMD ["/opt/lemmy/server--dev/target/release/lemmy"]
index 88b7a0de82ff6f1403aaa1c0c48a9f2252e080d5..9d1d3cd7d996f266f4e97e693be46bedf32e7cc6 100644 (file)
@@ -8,8 +8,6 @@ profiles:
           context: server
           docker:
             dockerfile: Dockerfile.dev
-          sync:
-            "***/*.rs": .
         - image: registry.gitlab.com/pojntfx/lemmy/ui.dev
           context: ui
           docker: