From 574393f485ac26da6c3969bd24e95cd98407e7e9 Mon Sep 17 00:00:00 2001 From: Felix Pojtinger Date: Sat, 27 Apr 2019 10:51:08 +0200 Subject: [PATCH] build: Improve server compile time with cache --- README.md | 8 ++++---- server/Dockerfile.dev | 12 ++++++++---- skaffold.yaml | 2 -- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cdd8c34c..8e3db385 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ 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 diff --git a/server/Dockerfile.dev b/server/Dockerfile.dev index 3a6f9278..c7951ce8 100644 --- a/server/Dockerfile.dev +++ b/server/Dockerfile.dev @@ -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"] diff --git a/skaffold.yaml b/skaffold.yaml index 88b7a0de..9d1d3cd7 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -8,8 +8,6 @@ profiles: context: server docker: dockerfile: Dockerfile.dev - sync: - "***/*.rs": . - image: registry.gitlab.com/pojntfx/lemmy/ui.dev context: ui docker: -- 2.44.1