Skip to content

cpfriend1721994/s3_static_web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

s3_static_web

Docker image for push static web pages to s3, with compress images and minify HTML/JS/CSS

Features

This image combine 3 components:

  1. s5cmd for synchronize static web to S3
  2. minify CLI for minify HTML5/CSS3/JS/JSON/SVG/XML
  3. s3static a mix between s5cmd, minify and some image tools (gifsicle/jpegoptim/pngquant), for push static web pages to s3, with compress images and minify HTML5/CSS3/JS/JSON/SVG/XML

Installation

docker pull tunnm/s3_static_web

Usage

s3static <directory path> <s3 destination path>

Configuration

# Configuration through environment variables (Mandatory):
AWS_ACCESS_KEY_ID=<your key>
AWS_SECRET_ACCESS_KEY=<your secret>
AWS_REGION=<your region>

Example

# s3static standalone
AWS_ACCESS_KEY_ID=xxxxxx AWS_SECRET_ACCESS_KEY=xxxxxx AWS_REGION=ap-southeast-1 s3static $(pwd) s3://xxxxxx/

# s3static with docker
docker run -v $(pwd):/input --rm --env AWS_ACCESS_KEY_ID=xxxxxx --env AWS_SECRET_ACCESS_KEY=xxxxxx --env AWS_REGION=ap-southeast-1 tunnm/s3_static_web s3static /input s3://xxxxxx/