Skip to content

An "oneshot" (Docker) container to recursively compress files statically with many common web compression algorithms (for web delivery)

License

Notifications You must be signed in to change notification settings

rugk/container-web-static-compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Container Web Static Compressor

An "oneshot" container to recursively compress files statically with these compression algorithms:

Always using the highest and best compression (that does not affect the decompression too badly).

The output is modified in place. Please use a webserver of your choice (ideally of course one that supports the static file delivery, like caddy) to serve these files.

Arguments

  • COMPRESSOR_DIRECTORY – you can use this to specify the directory to compress as an environmental variable

Alternatively, you can pass the first parameter as an argument to the container and it compresses this directory. Only one directory can (recursively) be provided, currently.

If no arguments are passed, /app is the directory assumed it tries to compress.

Example usage

This example uses podman, but you can replace the command with docker and that should work, too.

It also outputs the files when running the container:

podman run -v $PWD/app:/app:Z container-web-static-compressor:latest /app

Build it by yourself

podman build . -t container-web-static-compressor:latest