Skip to content

Commit

Permalink
Create Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cn-tools authored Feb 23, 2024
1 parent e7ba60a commit 1d998f4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
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

0 comments on commit 1d998f4

Please sign in to comment.