diff options
| author | Fuwn <[email protected]> | 2026-04-18 01:25:51 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-18 01:28:08 +0000 |
| commit | 24af289a76a99dcbca35fd9ffc1faf2efbcd3963 (patch) | |
| tree | 2841064c57c15725a1f83dd09cf6aa507b9e1f41 | |
| parent | chore(gleam.toml): Bump version (diff) | |
| download | mayu-main.tar.xz mayu-main.zip | |
| -rw-r--r-- | .dockerignore | 25 | ||||
| -rw-r--r-- | Dockerfile | 37 | ||||
| -rw-r--r-- | Earthfile | 43 |
3 files changed, 62 insertions, 43 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6666f44 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +.git +.gitignore +.github +.vscode +.DS_Store + +# Gleam +build +*.beam +*.ez +erl_crash.dump + +# Nix +flake.lock +flake.nix +result + +# SQLite +data +*.sqlite3 +*.db + +# Documentation/License +README.md +LICENSE diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..af799ad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +# syntax=docker/dockerfile:1.7 + +FROM ghcr.io/gleam-lang/gleam:v1.10.0-erlang-alpine AS build + +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] + +# hadolint ignore=DL3018 +RUN apk add --no-cache build-base + +WORKDIR /mayu + +COPY gleam.toml manifest.toml ./ +COPY src/ ./src/ + +RUN gleam build + +WORKDIR /mayu/build + +RUN gleam export erlang-shipment + +FROM ghcr.io/gleam-lang/gleam:v1.10.0-erlang-alpine + +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] + +WORKDIR /mayu + +COPY --from=build /mayu/build/erlang-shipment/ ./erlang-shipment/ +COPY themes/ ./themes/ +COPY index.html ./ +COPY gleam.toml ./ + +RUN grep '^version' gleam.toml | cut -d '"' -f 2 > .mayu-version \ + && rm gleam.toml + +ENTRYPOINT ["sh", "-c", "exec env MAYU_VERSION=\"$(cat /mayu/.mayu-version)\" /mayu/erlang-shipment/entrypoint.sh \"$@\"", "--"] + +CMD ["run"] diff --git a/Earthfile b/Earthfile deleted file mode 100644 index af01298..0000000 --- a/Earthfile +++ /dev/null @@ -1,43 +0,0 @@ -VERSION 0.8 - -image-all-platforms: - BUILD --platform=linux/amd64 --platform=linux/arm64 +image - -image: - ARG tag=latest - - FROM ghcr.io/gleam-lang/gleam:v1.10.0-erlang-alpine - - COPY +build/erlang-shipment/ /mayu/erlang-shipment/ - COPY themes/ /mayu/themes/ - COPY index.html /mayu/ - COPY gleam.toml /mayu/ - - ENV MAYU_VERSION=$(grep version /mayu/gleam.toml | cut -d '"' -f 2) - - RUN rm /mayu/gleam.toml - - WORKDIR /mayu/ - - ENTRYPOINT ["./erlang-shipment/entrypoint.sh"] - - CMD ["run"] - - SAVE IMAGE --push fuwn/mayu:${tag} - -build: - FROM ghcr.io/gleam-lang/gleam:v1.10.0-erlang-alpine - - RUN apk add --no-cache build-base - - WORKDIR /mayu/ - - COPY src/ /mayu/src/ - COPY gleam.toml /mayu/ - COPY manifest.toml /mayu/ - - RUN gleam build \ - && cd build/ \ - && gleam export erlang-shipment - - SAVE ARTIFACT /mayu/build/erlang-shipment/ |