Skip to content

Commit ec44195

Browse files
authored
Merge pull request #9 from Sengorius/develop
Adding Redis to the Proxy-Stack
2 parents 4b8e173 + aef9164 commit ec44195

3 files changed

Lines changed: 27 additions & 7 deletions

File tree

.env.template

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ DB_IMAGE=mysql:5.7
2727
PG_NAME=proxy-pg
2828
PG_IMAGE=postgres:12
2929

30+
# the Redis data storage
31+
REDIS_NAME=proxy-redis
32+
REDIS_IMAGE=redis:6
33+
3034
# PhpMyAdmin tool
3135
PMA_NAME=proxy-pma
3236
PMA_IMAGE=phpmyadmin/phpmyadmin:latest
@@ -44,15 +48,18 @@ SMTP_NAME=proxy-smtp
4448
###
4549

4650
# MySQL configuration
47-
MYSQL_HOST=proxy-db
48-
MYSQL_PORT=3306
4951
MYSQL_USER=root
50-
MYSQL_DATABASE=mysql
5152
MYSQL_ROOT_PASSWORD=root
53+
MYSQL_PORT=3306
5254

5355
# PostgreSQL configuration
5456
POSTGRES_USER=root
5557
POSTGRES_PASSWORD=root
58+
POSTGRES_PORT=5432
59+
60+
# Redis configuration
61+
REDIS_PASSWORD=root
62+
REDIS_PORT=6379
5663

5764

5865
############################################################

docker-compose.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
version: '3.5'
1+
version: '3.9'
22

33
volumes:
44
data-db:
55
data-pg:
6+
data-redis:
67

78
services:
89
proxy-nginx:
@@ -27,7 +28,7 @@ services:
2728
restart: unless-stopped
2829
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
2930
ports:
30-
- "3306:3306"
31+
- "${MYSQL_PORT}:3306"
3132
volumes:
3233
- data-db:/var/lib/mysql
3334
- ${DATA_PATH}:/var/data
@@ -38,11 +39,23 @@ services:
3839
env_file: .env
3940
restart: unless-stopped
4041
ports:
41-
- "5432:5432"
42+
- "${POSTGRES_PORT}:5432"
4243
volumes:
4344
- data-pg:/var/lib/postgresql/data
4445
- ${DATA_PATH}:/var/data
4546

47+
proxy-redis:
48+
image: ${REDIS_IMAGE}
49+
container_name: ${REDIS_NAME}
50+
env_file: .env
51+
restart: unless-stopped
52+
command: --appendonly yes
53+
ports:
54+
- "${REDIS_PORT}:6379"
55+
volumes:
56+
- data-redis:/data
57+
- ${DATA_PATH}:/var/data
58+
4659
proxy-pma:
4760
image: ${PMA_IMAGE}
4861
container_name: ${PMA_NAME}

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ supports
66
1. SSL (`https://`) for all local projects.
77
1. descriptive names instead of `localhost`.
88
1. running multiple projects at the same time
9-
- sharing database containers (MySQL & PostgreSQL)
9+
- sharing database containers (MySQL, PostgreSQL & Redis)
1010
- sharing certificates
1111
- sharing a mailcatcher
1212
- sharing a reverse proxy

0 commit comments

Comments
 (0)