lemmy/server/Dockerfile.dev
2019-04-27 10:51:08 +02:00

21 lines
589 B
Docker

# Setup env
FROM rust:1.33
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
# Enable deps caching
RUN mkdir -p src/bin
RUN echo 'fn main() { println!("Dummy") }' >src/bin/main.rs
# Install deps
COPY Cargo.toml .
COPY Cargo.lock .
RUN cargo build --release
RUN rm src/bin/main.rs
# Add app
COPY src/ src/
COPY migrations/ migrations/
RUN rm target/release/deps/lemmy*
RUN cargo build --release
# Run app
CMD ["/opt/lemmy/server--dev/target/release/lemmy"]