diff options
| author | Fuwn <[email protected]> | 2024-05-31 01:06:24 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-05-31 01:06:24 +0000 |
| commit | 176395164558dd5a403dce2db412765c2d1c1815 (patch) | |
| tree | e8f90f7813a13effd4f4bdff986f74388a218a37 | |
| parent | docs(mayu): bump mayu to 0.1.5 (diff) | |
| download | mayu-176395164558dd5a403dce2db412765c2d1c1815.tar.xz mayu-176395164558dd5a403dce2db412765c2d1c1815.zip | |
build(docker): switch to earthly builder
| -rw-r--r-- | Dockerfile | 25 | ||||
| -rw-r--r-- | Earthfile | 41 |
2 files changed, 41 insertions, 25 deletions
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c753c9e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM ghcr.io/gleam-lang/gleam:v1.2.0-erlang-alpine as builder - -WORKDIR /mayu/ - -COPY src/ /mayu/src/ -COPY themes/ /mayu/themes/ -COPY gleam.toml /mayu/ -COPY manifest.toml /mayu/ - -RUN apk add --no-cache build-base - -RUN gleam build \ - && cd build/ \ - && gleam export erlang-shipment - -FROM ghcr.io/gleam-lang/gleam:v1.2.0-erlang-alpine - -COPY --from=builder /mayu/build/erlang-shipment/ /mayu/erlang-shipment/ -COPY --from=builder /mayu/themes /mayu/themes/ - -WORKDIR /mayu/ - -ENTRYPOINT ["./erlang-shipment/entrypoint.sh"] - -CMD ["run"] diff --git a/Earthfile b/Earthfile new file mode 100644 index 0000000..568159e --- /dev/null +++ b/Earthfile @@ -0,0 +1,41 @@ +VERSION 0.8 + +all: + BUILD +docker + +docker: + ARG tag=latest + + FROM ghcr.io/gleam-lang/gleam:v1.2.0-erlang-alpine + + COPY +build/erlang-shipment/ /mayu/erlang-shipment/ + COPY themes/ /mayu/themes/ + + WORKDIR /mayu/ + + ENTRYPOINT ["./erlang-shipment/entrypoint.sh"] + + CMD ["run"] + + SAVE IMAGE --push fuwn/mayu:${tag} + +deps: + FROM ghcr.io/gleam-lang/gleam:v1.2.0-erlang-alpine + + RUN apk add --no-cache build-base + +build: + FROM +deps + + 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/ + |