Skip to content

Commit be024f8

Browse files
authored
feat: easy way to change image, update README.md, constraint for v1.24.3 (#16)
1 parent 9744a9d commit be024f8

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

README.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
1-
[![tests](https://github.com/ddev/ddev-memcached/actions/workflows/tests.yml/badge.svg)](https://github.com/ddev/ddev-memcached/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)
1+
[![tests](https://github.com/ddev/ddev-memcached/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddev/ddev-memcached/actions/workflows/tests.yml?query=branch%3Amain)
2+
[![last commit](https://img.shields.io/github/last-commit/ddev/ddev-memcached)](https://github.com/ddev/ddev-memcached/commits)
3+
[![release](https://img.shields.io/github/v/release/ddev/ddev-memcached)](https://github.com/ddev/ddev-memcached/releases/latest)
24

3-
## What is this?
5+
# DDEV Memcached
46

5-
This repository allows you to quickly install Memcached into a [DDEV](https://ddev.readthedocs.io) project using `ddev get ddev/ddev-memcached`.
7+
## Overview
68

7-
## Installation
8-
9-
For DDEV v1.23.5 or above run
9+
[Memcached](https://memcached.org/) is a free & open source, high-performance, distributed memory object caching system.
1010

11-
```sh
12-
ddev add-on get ddev/ddev-memcached && ddev restart
13-
```
11+
This add-on integrates Memcached into your [DDEV](https://ddev.com/) project.
1412

15-
For earlier versions of DDEV run
13+
## Installation
1614

17-
```sh
18-
ddev get ddev/ddev-memcached && ddev restart
15+
```bash
16+
ddev add-on get ddev/ddev-memcached
17+
ddev restart
1918
```
2019

21-
## Explanation
22-
23-
This Memcached recipe for [DDEV](https://ddev.readthedocs.io) installs a [`.ddev/docker-compose.memcached.yaml`](docker-compose.memcached.yaml) using the `memcached` Docker image.
20+
After installation, make sure to commit the `.ddev` directory to version control.
2421

25-
## Interacting with Memcached
22+
## Usage
2623

2724
* The Memcached instance will listen on TCP port 11211 (the Memcached default).
2825
* Configure your application to access Memcached on the host:port `memcached:11211`.
2926
* To reach the Memcached admin interface, run `ddev ssh` to connect to the web container, then use `nc` or `telnet` to connect to the Memcached container on port 11211, i.e. `nc memcached 11211`. You can then run commands such as `stats` to see usage information. See [cheatsheet](https://lzone.de/cheat-sheet/memcached) for more commands.
27+
28+
## Advanced Customization
29+
30+
To change the docker image:
31+
32+
```bash
33+
ddev dotenv set .ddev/.env.memcached --memcached-docker-image=memcached:1.6
34+
ddev add-on get ddev/ddev-memcached
35+
ddev restart
36+
```
37+
38+
Make sure to commit the `.ddev/.env.memcached` file to version control.
39+
40+
## Credits
41+
42+
**Maintained by the [DDEV team](https://ddev.com/support-ddev/)**

docker-compose.memcached.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
# DDEV-Local memcached recipe file.
21
#ddev-generated
3-
# To use this in your own project:
4-
# 1. Copy this file to your project's ".ddev" directory.
5-
# 2. Launch "ddev start".
6-
# 3. Configure the project to look for memcached at hostname "memcached" and
7-
# port 11211.
8-
# 4. Optional: adjust the 'command' line below to change CLI flags sent to
9-
# memcached.
10-
112
services:
123
memcached:
134
container_name: ddev-${DDEV_SITENAME}-memcached
14-
image: memcached:1.6
5+
image: ${MEMCACHED_DOCKER_IMAGE:-memcached:1.6}
156
restart: "no"
167
# memcached is available at this port inside the container.
178
expose:
@@ -25,4 +16,5 @@ services:
2516
command: ["-m", "128"]
2617

2718
volumes:
28-
- ".:/mnt/ddev_config"
19+
- ".:/mnt/ddev_config"
20+
- "ddev-global-cache:/mnt/ddev-global-cache"

install.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: memcached
22

3-
pre_install_actions:
4-
5-
# files and directories listed here are copied into .ddev
63
project_files:
7-
- docker-compose.memcached.yaml
4+
- docker-compose.memcached.yaml
85

9-
post_install_actions:
6+
ddev_version_constraint: '>= v1.24.3'

0 commit comments

Comments
 (0)