-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
FROM rust:1-alpine3.19 as chef | ||
ENV RUSTFLAGS="-C target-feature=-crt-static" | ||
RUN apk update | ||
RUN apk add --no-cache pkgconfig openssl openssl-dev musl-dev | ||
RUN cargo install cargo-chef | ||
WORKDIR /app | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get -qq update | ||
|
||
RUN apt-get install -y -q \ | ||
git curl ca-certificates build-essential \ | ||
libssl-dev pkg-config software-properties-common | ||
|
||
# install rustup and add to path | ||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
RUN cargo install sqlx-cli | ||
RUN cargo install cargo-watch | ||
RUN rustup component add clippy | ||
RUN rustup component add rust-analyzer | ||
|
||
# install neovim and other dev stuff | ||
RUN apt-add-repository ppa:neovim-ppa/unstable | ||
RUN apt-get update | ||
RUN apt-get install -y -q neovim fzf \ | ||
postgresql-client ripgrep | ||
|
||
FROM chef as planner | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
ENV TERM xterm-256color | ||
|
||
FROM chef as builder | ||
COPY --from=planner /app/recipe.json recipe.json | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
COPY . . | ||
RUN cargo build --release | ||
RUN strip target/release/geode-index | ||
RUN git config --global --add safe.directory /app | ||
|
||
FROM alpine:3.19 | ||
WORKDIR /app | ||
COPY --from=builder /app/target/release/geode-index /app/target/release/geode-index | ||
COPY . . | ||
RUN apk add --no-cache libgcc | ||
RUN chmod +x /app/target/release/geode-index | ||
EXPOSE 3000 | ||
ENTRYPOINT [ "/app/target/release/geode-index" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters