2023-02-09 00:31:38 -05:00
|
|
|
VERSION 0.6
|
|
|
|
|
|
|
|
docs-build:
|
2023-03-11 17:50:23 -05:00
|
|
|
FROM ruby:latest
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
WORKDIR /app
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
RUN gem install coderay
|
|
|
|
RUN gem install rouge
|
|
|
|
RUN gem install asciidoctor
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
# These dependencies are required for asciidoctor-mathematical
|
|
|
|
RUN apt-get update
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y install bison flex libffi-dev libxml2-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev fonts-lyx cmake
|
|
|
|
RUN gem install asciidoctor-mathematical
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
COPY ./README.adoc docs/index.adoc
|
|
|
|
COPY --dir ./docs .
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-14 00:23:14 -04:00
|
|
|
RUN asciidoctor -r asciidoctor-mathematical --embedded -- ./docs/*.adoc
|
2023-03-11 17:50:23 -05:00
|
|
|
RUN \
|
|
|
|
find docs -type f -not -iname '*.html' -not -iname '*.png' -not -iname '*.svg' -delete && \
|
|
|
|
:
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
SAVE ARTIFACT ./docs
|
2023-02-09 00:31:38 -05:00
|
|
|
|
|
|
|
docs:
|
2023-03-11 17:50:23 -05:00
|
|
|
FROM golang:latest
|
|
|
|
WORKDIR /app
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
GIT CLONE https://github.com/tdewolff/minify/ minify/
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
RUN cd minify && go install ./cmd/minify
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-11 17:50:23 -05:00
|
|
|
COPY +docs-build/docs/ ./docs/
|
|
|
|
RUN minify --version
|
|
|
|
RUN minify --sync --recursive --output output/ ./docs/
|
2023-02-09 00:31:38 -05:00
|
|
|
|
2023-03-17 23:10:12 -04:00
|
|
|
SAVE ARTIFACT output/* AS LOCAL ./web-frontend/src/lib/docs/
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# rust-deps:
|
|
|
|
# FROM rust:latest
|
|
|
|
# ENV CARGO_HOME=/deps
|
|
|
|
# WORKDIR /work
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# COPY ./web/Cargo.toml .
|
|
|
|
# # This is a binary program, expose a main.rs file
|
|
|
|
# RUN mkdir src && touch src/main.rs
|
|
|
|
# RUN cargo fetch
|
|
|
|
# SAVE ARTIFACT /deps
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# rust-builder:
|
|
|
|
# FROM rust:latest
|
|
|
|
# ENV CARGO_HOME=/deps
|
|
|
|
# WORKDIR /work
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# # Linux
|
|
|
|
# RUN rustup target add x86_64-unknown-linux-musl
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# SAVE IMAGE docker-wg:5000/rust-builder
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# rust-build:
|
|
|
|
# FROM +rust-builder
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# COPY +rust-deps/deps /deps
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# ARG TOOLCHAIN
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# # Cache whatever dependency builds you can
|
|
|
|
# COPY ./web/Cargo.toml .
|
|
|
|
# RUN \
|
|
|
|
# mkdir src && touch src/lib.rs && \
|
|
|
|
# cargo build --offline --release --target "$TOOLCHAIN" --jobs 1 && \
|
|
|
|
# rm src/lib.rs && rmdir src && \
|
|
|
|
# :
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# # Actually build the program
|
|
|
|
# COPY ./web .
|
|
|
|
# RUN cargo build --offline --release --target "$TOOLCHAIN" --jobs 1
|
|
|
|
|
|
|
|
# ARG EXT
|
|
|
|
# ARG STRIP_CMD=x86_64-linux-gnu-strip
|
|
|
|
# ARG APP_NAME=web
|
|
|
|
|
|
|
|
# RUN if [ "$STRIP_CMD" ]; then "$STRIP_CMD" "target/$TOOLCHAIN/release/$APP_NAME$EXT"; fi
|
|
|
|
# # --force for windows since multiple hardlinks
|
|
|
|
# RUN xz --force --keep "target/$TOOLCHAIN/release/$APP_NAME$EXT"
|
|
|
|
|
|
|
|
# # SAVE ARTIFACT target/$TOOLCHAIN/release/$APP_NAME$EXT AS LOCAL dist/
|
|
|
|
# SAVE ARTIFACT target/$TOOLCHAIN/release/$APP_NAME$EXT.xz AS LOCAL dist/$APP_NAME-$TOOLCHAIN$EXT.xz
|
|
|
|
|
|
|
|
rust-image:
|
|
|
|
FROM scratch
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
# ARG TOOLCHAIN=x86_64-unknown-linux-musl
|
|
|
|
# COPY --build-arg TOOLCHAIN=$TOOLCHAIN +rust-build/work/target/$TOOLCHAIN/release/$APP_NAME /
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
COPY ./target/x86_64-unknown-linux-musl/release/web /xpin-web
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
ENV ROCKET_ADDRESS=0.0.0.0
|
|
|
|
ENV ROCKET_PORT=8000
|
|
|
|
ENV ROCKET_LOG_LEVEL=normal
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
EXPOSE 8000
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-11 18:12:13 -05:00
|
|
|
ENTRYPOINT ["/xpin-web"]
|
2023-03-11 17:50:23 -05:00
|
|
|
|
2023-03-12 00:57:09 -05:00
|
|
|
SAVE IMAGE gitea.austen-wares.com/public/xpin-server
|
2023-02-09 00:31:38 -05:00
|
|
|
|
|
|
|
all:
|
2023-03-11 17:50:23 -05:00
|
|
|
BUILD +docs
|
2023-03-11 18:12:13 -05:00
|
|
|
BUILD +rust-image
|