Update dockerfile
This commit is contained in:
parent
39f0408929
commit
cc22a92daf
@ -1,29 +1,15 @@
|
|||||||
FROM rust:1.75.0 as build
|
FROM rust:1.79.0 as build
|
||||||
ENV PKG_CONFIG_ALLOW_CROSS=1
|
ENV PKG_CONFIG_ALLOW_CROSS=1
|
||||||
|
|
||||||
WORKDIR /usr/src/labrinth
|
WORKDIR /usr/src/labrinth
|
||||||
# Download and compile deps
|
|
||||||
COPY Cargo.toml .
|
|
||||||
COPY Cargo.lock .
|
|
||||||
COPY docker_utils/dummy.rs .
|
|
||||||
# Change temporarely the path of the code
|
|
||||||
RUN sed -i 's|src/main.rs|dummy.rs|' Cargo.toml
|
|
||||||
# Build only deps
|
|
||||||
RUN cargo build --release --features jemalloc
|
|
||||||
# Now return the file back to normal
|
|
||||||
RUN sed -i 's|dummy.rs|src/main.rs|' Cargo.toml
|
|
||||||
|
|
||||||
# Copy everything
|
|
||||||
COPY . .
|
COPY . .
|
||||||
# Build our code
|
RUN cargo build --release
|
||||||
ARG SQLX_OFFLINE=true
|
|
||||||
RUN cargo build --release --features jemalloc
|
|
||||||
|
|
||||||
# Final Stage
|
|
||||||
FROM ubuntu:latest
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends ca-certificates \
|
&& apt-get install -y --no-install-recommends ca-certificates openssl \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user