Stock Off-The-Shelf Examples

This is a list of stock examples that can be copy-pasted for adding common configurations to your applications

Redis Example

Copy this template to add Redis to your application service stack.

services:
- name: redis
  image: redis:6-alpine
  registry: public
  ports:
  - type: container_port
    port: '6379'
  readiness_probe:
    exec:
      command:
      - redis-cli
      - ping
    failure_threshold: 6
    period_seconds: 30
    timeout_seconds: 10
    initial_delay_seconds: 30

To add persistent storage, use this:

services:
- name: redis
  image: redis:6-alpine
  registry: public
  ports:
  - type: container_port
    port: '6379'
  volumes:
  - type: persistent
    name: redis-data
    mount_path: "/data"
  args:
  - "--save"
  - 60
  - 1
  - "--loglevel"
  - warning
  readiness_probe:
    exec:
      command:
      - redis-cli
      - ping
    failure_threshold: 6
    period_seconds: 30
    timeout_seconds: 10
    initial_delay_seconds: 30

Last updated