Git Product home page Git Product logo

dokku-memcached's Introduction

dokku memcached (beta) Build Status IRC Network

Official memcached plugin for dokku. Currently defaults to installing memcached 1.4.25.

requirements

  • dokku 0.4.0+
  • docker 1.8.x

installation

# on 0.3.x
cd /var/lib/dokku/plugins
git clone https://github.com/dokku/dokku-memcached.git memcached
dokku plugins-install

# on 0.4.x
dokku plugin:install https://github.com/dokku/dokku-memcached.git memcached

commands

memcached:connect <name>           Connect via telnet to a memcached service
memcached:create <name>            Create a memcached service with environment variables
memcached:destroy <name>           Delete the service and stop its container if there are no links left
memcached:expose <name> [port]     Expose a memcached service on custom port if provided (random port otherwise)
memcached:info <name>              Print the connection information
memcached:link <name> <app>        Link the memcached service to the app
memcached:list                     List all memcached services
memcached:logs <name> [-t]         Print the most recent log(s) for this service
memcached:promote <name> <app>     Promote service <name> as MEMCACHED_URL in <app>
memcached:restart <name>           Graceful shutdown and restart of the memcached service container
memcached:start <name>             Start a previously stopped memcached service
memcached:stop <name>              Stop a running memcached service
memcached:unexpose <name>          Unexpose a previously exposed memcached service
memcached:unlink <name> <app>      Unlink the memcached service from the app

usage

# create a memcached service named lolipop
dokku memcached:create lolipop

# you can also specify the image and image
# version to use for the service
# it *must* be compatible with the
# official memcached image
export MEMCACHED_IMAGE="memcached"
export MEMCACHED_IMAGE_VERSION="1.4"

# you can also specify custom environment
# variables to start the memcached service
# in semi-colon separated forma
export MEMCACHED_CUSTOM_ENV="USER=alpha;HOST=beta"

# create a memcached service
dokku memcached:create lolipop

# get connection information as follows
dokku memcached:info lolipop

# a memcached service can be linked to a
# container this will use native docker
# links via the docker-options plugin
# here we link it to our 'playground' app
# NOTE: this will restart your app
dokku memcached:link lolipop playground

# the following environment variables will be set automatically by docker (not
# on the app itself, so they won’t be listed when calling dokku config)
#
#   DOKKU_MEMCACHED_LOLIPOP_NAME=/lolipop/DATABASE
#   DOKKU_MEMCACHED_LOLIPOP_PORT=tcp://172.17.0.1:11211
#   DOKKU_MEMCACHED_LOLIPOP_PORT_11211_TCP=tcp://172.17.0.1:11211
#   DOKKU_MEMCACHED_LOLIPOP_PORT_11211_TCP_PROTO=tcp
#   DOKKU_MEMCACHED_LOLIPOP_PORT_11211_TCP_PORT=11211
#   DOKKU_MEMCACHED_LOLIPOP_PORT_11211_TCP_ADDR=172.17.0.1
#
# and the following will be set on the linked application by default
#
#   MEMCACHED_URL=memcached://dokku-memcached-lolipop:11211
#
# NOTE: the host exposed here only works internally in docker containers. If
# you want your container to be reachable from outside, you should use `expose`.

# another service can be linked to your app
dokku memcached:link other_service playground

# since MEMCACHED_URL is already in use, another environment variable will be
# generated automatically
#
#   DOKKU_MEMCACHED_BLUE_URL=memcached://dokku-memcached-other-service:11211

# you can then promote the new service to be the primary one
# NOTE: this will restart your app
dokku memcached:promote other_service playground

# this will replace MEMCACHED_URL with the url from other_service and generate
# another environment variable to hold the previous value if necessary.
# you could end up with the following for example:
#
#   MEMCACHED_URL=memcached://dokku-memcached-other-service:11211
#   DOKKU_MEMCACHED_BLUE_URL=memcached://dokku-memcached-other-service:11211
#   DOKKU_MEMCACHED_SILVER_URL=memcached://dokku-memcached-lolipop:11211

# you can also unlink a memcached service
# NOTE: this will restart your app and unset related environment variables
dokku memcached:unlink lolipop playground

# you can tail logs for a particular service
dokku memcached:logs lolipop
dokku memcached:logs lolipop -t # to tail

# finally, you can destroy the container
dokku memcached:destroy lolipop

dokku-memcached's People

Contributors

flink avatar josegonzalez avatar treythomas123 avatar

Watchers

 avatar  avatar

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.