From 7374514dba6da34f4f8260eb69daf675f2b683a5 Mon Sep 17 00:00:00 2001 From: Luc Ritchie Date: Sun, 10 Sep 2023 19:10:12 -0400 Subject: [PATCH] Add Dockerfile and pre-commit hook config --- .pre-commit-hooks.yaml | 6 ++++++ Dockerfile | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .pre-commit-hooks.yaml create mode 100644 Dockerfile diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 00000000..f47dee13 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,6 @@ +- id: optimize-files + name: Optimize Images and Zips + description: Losslessly optimize newly-added GZIP, ZIP, JPEG, and PNG files + entry: /app/ect + language: docker + files: '.*\.(png|jpe?g|zip|gz)$' diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..65dd6c38 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM alpine:3.18 as base +WORKDIR /app +RUN apk add --no-cache libgcc libstdc++ + +FROM base as build +RUN apk add --no-cache cmake g++ make nasm +COPY . . +RUN cmake -B build src +RUN make -C build -j + +FROM base as runtime +COPY --from=build /app/build/ect . +CMD ["/app/ect"]