1- FROM rust:1-alpine3.19 as chef
2- ENV RUSTFLAGS="-C target-feature=-crt-static"
3- RUN apk update
4- RUN apk add --no-cache pkgconfig openssl openssl-dev musl-dev
5- RUN cargo install cargo-chef
6- WORKDIR /app
1+ FROM ubuntu:22.04
2+
3+ RUN apt-get -qq update
4+
5+ RUN apt-get install -y -q \
6+ git curl ca-certificates build-essential \
7+ libssl-dev pkg-config software-properties-common
8+
9+ # install rustup and add to path
10+ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
11+ ENV PATH="/root/.cargo/bin:${PATH}"
12+
13+ RUN cargo install sqlx-cli
14+ RUN cargo install cargo-watch
15+ RUN rustup component add clippy
16+ RUN rustup component add rust-analyzer
17+
18+ # install neovim and other dev stuff
19+ RUN apt-add-repository ppa:neovim-ppa/unstable
20+ RUN apt-get update
21+ RUN apt-get install -y -q neovim fzf \
22+ postgresql-client ripgrep
723
8- FROM chef as planner
9- COPY . .
10- RUN cargo chef prepare --recipe-path recipe.json
24+ ENV TERM xterm-256color
1125
12- FROM chef as builder
13- COPY --from=planner /app/recipe.json recipe.json
14- RUN cargo chef cook --release --recipe-path recipe.json
15- COPY . .
16- RUN cargo build --release
17- RUN strip target/release/geode-index
26+ RUN git config --global --add safe.directory /app
1827
19- FROM alpine:3.19
2028WORKDIR /app
21- COPY --from=builder /app/target/release/geode-index /app/target/release/geode-index
22- COPY . .
23- RUN apk add --no-cache libgcc
24- RUN chmod +x /app/target/release/geode-index
25- EXPOSE 3000
26- ENTRYPOINT [ "/app/target/release/geode-index" ]
0 commit comments