-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# special thx to https://github.com/343dev | ||
# based on https://github.com/343dev/optimizt/issues/4 | ||
|
||
FROM node:18.17.0-bullseye-slim | ||
|
||
WORKDIR /app | ||
|
||
ENV NODE_ENV="production" | ||
ENV SHELL="/bin/bash" | ||
|
||
RUN apt update \ | ||
&& apt install --yes --no-install-recommends build-essential libpng16-16 libjpeg62-turbo libjpeg62-turbo-dev libpng-dev pkg-config dh-autoreconf \ | ||
&& npm install --global @343dev/optimizt chokidar-cli \ | ||
&& npm cache clean --force \ | ||
&& apt purge --yes build-essential pkg-config libpng-dev libjpeg62-turbo-dev dh-autoreconf \ | ||
&& apt autoremove --yes --purge \ | ||
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man | ||
|
||
WORKDIR /src | ||
|
||
CMD chokidar "/src/input/**/*" \ | ||
--command "if [ '{event}' = 'add' ]; then optimizt --verbose /src/input && mv /src/input/* /src/output; fi;" \ | ||
--polling \ | ||
--verbose |