Skip to content

Commit 1443c50

Browse files
authored
Simple setup for docker-compose tests (#246)
1 parent e1cae24 commit 1443c50

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ trim_trailing_whitespace = true
1212

1313
[*.md]
1414
trim_trailing_whitespace = false
15+
16+
[*.yml]
17+
indent_size = 2

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
/tests/CacheTestCase.php
66
/tests/BaseTestCase.php
77
/tests/data/config.local.php
8-
/tests/docker
98
/tests/dockerids

tests/docker/docker-compose.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: '3.8'
2+
3+
# NOTE: When using docker-compose for testing, make sure you set 'hostname' to 'redis' in tests/data/config.php
4+
5+
services:
6+
7+
PHP:
8+
image: "yiisoftware/yii2-php:7.4-apache"
9+
networks:
10+
- yii2-redis
11+
volumes:
12+
- ../..:/app # Mount source-code for development
13+
14+
Redis:
15+
image: "redis"
16+
networks:
17+
- yii2-redis
18+
ports:
19+
- "6379:6379"
20+
21+
networks:
22+
yii2-redis:
23+
driver: bridge
24+
name: yii2-redis

0 commit comments

Comments
 (0)