diff --git a/Containerfile.run b/Containerfile.run index d6616f6..81a8be3 100644 --- a/Containerfile.run +++ b/Containerfile.run @@ -1,11 +1,10 @@ -FROM ubuntu:24.04 +FROM alpine:latest AS build ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH -RUN apt update -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y gcc gcc-multilib pkg-config libssl-dev curl mysql-client-8.0 npm +RUN apk add gcc build-base pkgconfig openssl-dev openssl-libs-static curl mysql-client npm RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain nightly WORKDIR /usr/src/reminder-rs @@ -32,5 +31,16 @@ RUN npm ci --prefix reminder-dashboard && npm run build --prefix reminder-dashbo # Build and install the Rust binary RUN cargo install --path . +FROM alpine:latest AS runtime + +WORKDIR /usr/src/reminder-rs + +COPY --from=build /usr/local/cargo/bin/reminder-rs /usr/local/bin/reminder-rs +COPY --from=build /usr/src/reminder-rs/static /usr/src/reminder-rs/static +COPY --from=build /usr/src/reminder-rs/templates /usr/src/reminder-rs/templates + +RUN apk add python3 py3-pip +RUN pip3 install --no-cache --break-system-packages dateparser + EXPOSE 18920 CMD ["reminder-rs"]