humanmade/tachyon-docker

Name: tachyon-docker

Owner: Human Made

Description: Docker container for a Tachyon server

Created: 2016-07-18 17:13:16.0

Updated: 2016-10-31 04:27:14.0

Pushed: 2016-10-10 09:47:36.0

Homepage: null

Size: 22

Language: null

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Tachyon Docker

Containerised Tachyon server for on the fly image resizing.
A Human Made project. Maintained by @roborourke.
Usage

You can pull the latest image using:

er pull humanmade/tachyon

Or build the Dockerfile locally using:

clone --recursive https://github.com/humanmade/tachyon-docker.git
achyon-docker
er build --tag humanmade/tachyon ./

The container should always be run with the following environment variables:

er run -d \
name tachyon
 AWS_REGION=<region> \
 AWS_S3_BUCKET=<bucket> \
 AWS_S3_ENDPOINT=<endpoint>
manmade/tachyon

You may need to ensure that the container can see your S3 server. There are a few ways to do this:

  1. Add to the hosts file when running the container using

    d-host <s3-host>:<ip>
    
  2. Link the container to your s3 container and use that endpoint

    nk s3
    WS_S3_ENDPOINT=http://s3:<s3-port>/
    
Vagrant

This repo comes with a Vagrantfile to let you set up a local instance or instances of Tachyon coupled to a fake S3 server courtesy of the fake-s3 project.

Vagrant Plugins

You'll need to install two Vagrant plugins for this container to provision correctly.

  1. vagrant plugin install vagrant-hostsupdater
  2. vagrant plugin install vagrant-vbguest

Make sure to do a recursive clone of this repo:

clone --recursive https://github.com/humanmade/tachyon-docker.git
achyon-docker
ant up

You'll get 2 servers by default:

n.srv # Tachyon image proxy server
rv    # Fake S3 server

The S3 server can be used locally by providing the endpoint argument to your AWS client be it the CLI, JS or PHP SDKs.

WordPress

To use this with WordPress and the S3-Uploads plugin locally you would add the following to your config file:

ne( 'S3_UPLOADS_BUCKET_URL', 'http://s3.srv/local' );
ne( 'S3_UPLOADS_BUCKET', 'local' );

hese can be any non falsy value
ne( 'S3_UPLOADS_KEY', 'missing' );
ne( 'S3_UPLOADS_SECRET', 'missing' );
ne( 'S3_UPLOADS_REGION', 'eu-west-1' );

And add a small script to your mu-plugins folder:

p
filter( 's3_uploads_s3_client_params', function( $params ) {
$params['endpoint'] = 'http://s3.srv/';
$params['path_style'] = true;
//$params['debug'] = true; // Useful if things aren't working to double check IPs etc
return $params;

You can then install the WordPress Tachyon plugin and configure it:

achyon URL
ne( 'TACHYON_URL', 'http://tchyn.srv/uploads' );

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.