Skip to content

Commit

Permalink
Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Oct 16, 2024
1 parent 39f0408 commit cc22a92
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions apps/labrinth/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
FROM rust:1.75.0 as build
FROM rust:1.79.0 as build
ENV PKG_CONFIG_ALLOW_CROSS=1

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 . .
# Build our code
ARG SQLX_OFFLINE=true
RUN cargo build --release --features jemalloc
RUN cargo build --release


# Final Stage
FROM ubuntu:latest
FROM debian:bookworm-slim

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 \
&& rm -rf /var/lib/apt/lists/*

Expand Down

0 comments on commit cc22a92

Please sign in to comment.