Skip to content

Commit 83ee8eb

Browse files
authored
Merge pull request #10 from movabletype/fix-for-new-docker-compose
Fix for new docker compose
2 parents 8d5e3ff + 9891998 commit 83ee8eb

5 files changed

Lines changed: 19 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
* Enable to start service via.
1212
* e.g. DOCKER\_MT\_SERVICES=postfix
13+
* Support docker-compose 2.x
1314

1415
### Fixed
1516

mt/cgi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ services:
33
mt:
44
restart: always
55
command: "/usr/sbin/httpd -D FOREGROUND"
6+
7+
mt-watcher:
8+
command: "/bin/true"

mt/common.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ services:
1717
- "support:/var/www/cgi-bin/mt/mt-static/support"
1818
# override entrypoint
1919
- "./docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh"
20+
labels:
21+
mt-dev.service: "mt"
2022

2123
httpd:
2224
image: ${DOCKER_HTTPD_IMAGE:-movabletype/test:php-7.3}
@@ -38,7 +40,16 @@ services:
3840
command: apache2-foreground
3941

4042
mt-watcher:
41-
image: busybox
43+
build:
44+
context: mt-watcher
45+
working_dir: /var/www/cgi-bin/mt
46+
environment:
47+
PERL_FNS_NO_OPT: ${PERL_FNS_NO_OPT:-0}
48+
DISABLE_MT_WATCHER: ${DISABLE_MT_WATCHER:-0}
49+
volumes:
50+
- "${MT_HOME_PATH:-../../movabletype}:/var/www/cgi-bin/mt"
51+
- "./mt-watcher.pl:/usr/local/lib/mt/bin/mt-watcher.pl"
52+
- /var/run/docker.sock:/var/run/docker.sock
4253

4354
volumes:
4455
site:

mt/mt-watcher.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
return unless @paths;
3232

3333
print( join( "\n", @paths ) . "\n" );
34-
system('docker kill -s HUP mt_mt_1');
34+
my $mt_container_id = `docker ps -q --filter label=mt-dev.service=mt`;
35+
system("docker kill -s HUP $mt_container_id");
3536

3637
# throttling
3738
sleep(1);

mt/psgi.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ services:
77
MT_PID_FILE_PATH: ${MT_PID_FILE_PATH:-/tmp/mt.psgi.pid}
88
volumes:
99
- "./plackup-mt:/usr/local/lib/mt/bin/plackup-mt"
10+
1011
mt-watcher:
11-
build:
12-
context: mt-watcher
13-
image: movabletype/mt-watcher
14-
working_dir: /var/www/cgi-bin/mt
1512
command: /usr/local/lib/mt/bin/mt-watcher.pl
16-
environment:
17-
PERL_FNS_NO_OPT: ${PERL_FNS_NO_OPT:-0}
18-
DISABLE_MT_WATCHER: ${DISABLE_MT_WATCHER:-0}
19-
volumes:
20-
- "${MT_HOME_PATH:-../../movabletype}:/var/www/cgi-bin/mt"
21-
- "./mt-watcher.pl:/usr/local/lib/mt/bin/mt-watcher.pl"
22-
- /var/run/docker.sock:/var/run/docker.sock

0 commit comments

Comments
 (0)