Giter Site home page Giter Site logo

silinternational / docker-sync-with-s3 Goto Github PK

View Code? Open in Web Editor NEW
15.0 8.0 16.0 10 KB

Docker image that runs a single cron job to sync files with S3 as defined via environment variables

License: MIT License

Shell 32.82% Python 52.08% Dockerfile 15.10%

docker-sync-with-s3's Introduction

docker-sync-with-s3

Docker image that runs a single cron job to sync files with S3 as defined via environment variables.

This image can be used to either sync files from a container to S3 or from S3 to a container.

It is intended that a single instance of this image will run a single cron job and sync process. If you have multiple directories to sync, then you should run multiple containers each with the appropriate configuration for that directory.

Docker Hub

This image is built automatically on the Docker Hub as silintl/sync-with-s3

Running locally

  1. Clone this repo
  2. Copy local.env.dist to local.env and update values as appropriate
  3. Run docker-compose up -d

Expected Environment Variables

  1. ACCESS_KEY - AWS Access Key
  2. SECRET_KEY - AWS Secret Access Key
  3. CRON_SCHEDULE - Schedule for cron job, for every 15 minutes it would be: */15 * * * *
  4. SOURCE_PATH - Source files to be synced, example: /var/www/uploads
  5. DESTINATION_PATH - Destination of where to sync files to, example: s3://my-bucket/site-uploads
  6. BUCKET_LOCATION - AWS Region for bucket, ex: us-east-1
  7. LOGENTRIES_KEY - (optional) If provided, the image will send command output to syslog with priority user.info.
  8. S3SYNC_ARGS - (optional) If provided, the arguments will be included in the aws s3 sync command. For example, setting S3SYNC_ARGS=--delete will cause files in the destination to be deleted if they no longer exist in the source.

Volumes

You will need to define volumes in your Docker configuration for sharing filesystem between your application containers and this sync container.

docker-sync-with-s3's People

Contributors

dalenewby avatar fillup avatar johnlee1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-sync-with-s3's Issues

Runs under root context

Hi,

your image runs under root context.
Is that possible to move this to another user? This image doesn‘t work on platforms that don‘t support the root context.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.