47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
FROM alpine:latest AS build
|
|
|
|
ENV RUSTUP_HOME=/usr/local/rustup \
|
|
CARGO_HOME=/usr/local/cargo \
|
|
PATH=/usr/local/cargo/bin:$PATH
|
|
|
|
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
|
|
|
|
# Docker is shit
|
|
COPY ./.sqlx ./.sqlx
|
|
COPY ./assets ./assets
|
|
COPY ./conf ./conf
|
|
COPY ./extract_derive ./extract_derive
|
|
COPY ./migrations ./migrations
|
|
COPY ./recordable_derive ./recordable_derive
|
|
COPY ./reminder-dashboard ./reminder-dashboard
|
|
COPY ./src ./src
|
|
COPY ./static ./static
|
|
COPY ./templates ./templates
|
|
COPY ./build.rs ./
|
|
COPY ./Cargo.lock ./
|
|
COPY ./Cargo.toml ./
|
|
COPY ./dp.py ./
|
|
|
|
# Build dashboard assets explicitly to ensure dist exists
|
|
RUN npm ci --prefix reminder-dashboard && npm run build --prefix reminder-dashboard
|
|
|
|
# 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"]
|