Watches a directory recursively for new files and uploads them to S3.
Configuration is controlled by environment variables.
WATCH_PATH
Absolute path to directory to watch. Must include trailing slash. e.g. /absolute/path/to/files/
AWS_REGION
AWS region e.g. ap-southeast-2
AWS_S3_BUCKET
Name of S3 bucket files will be uploaded to e.g. mybucket.example.com
AWS_S3_KEY_PREFIX (Optional)
String to prepend to file names when constructing keys. Defaults to an empty string.
AWS_S3_STORAGE_CLASS (Optional)
S3 storage class used for storing objects. Can be STANDARD, STANDARD_IA or ONEZONE_IA. Defaults to STANDARD.
WATCH_INTERVAL (Optional)
Duration in milliseconds specifying how often the watch directory should be polled for new files. Defaults to 500.
PATH_PATTERN (Optional)
A regular expression used to filter paths. For example "mp4$" would only upload files ending with "mp4". Defaults to an empty string.
Build Docker image by running the following from the repository root.
docker build -t willdady/go-watch-s3:latest .