Skip to content

Commit 2a9b874

Browse files
authored
Merge pull request #20 from movabletype/feature-dockerfiles
Feature dockerfiles
2 parents b9c6380 + 19c29c9 commit 2a9b874

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Added
10+
11+
Added support for specifying the cpanfile to be referenced at startup with DOCKER_MT_CPANFILES.
12+
The default value is t/cpanfile.
13+
914
## [2.0.0] - 2022-02-21
1015

1116
### Added

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export DOCKER_COMPOSE_YAML_MIDDLEWARES:=-f ./mt/mysql.yml -f ./mt/memcached.yml
77
export UP_ARGS:=-d
88
export MT_HOME_PATH:=${MAKEFILE_DIR}/../movabletype
99
export UPDATE_BRANCH:=yes
10+
export DOCKER_MT_CPANFILES:=t/cpanfile
1011

1112
MT_CONFIG_CGI=${shell [ -e mt-config.cgi ] && echo mt-config.cgi || echo mt-config.cgi-original}
1213
BASE_ARCHIVE_PATH=${MAKEFILE_DIR}/archive
@@ -30,6 +31,7 @@ export DOCKER_MT_BUILD_CONTEXT
3031
export DOCKER_MT_DOCKERFILE
3132
export DOCKER_MT_IMAGE
3233
export DOCKER_MT_SERVICES
34+
export DOCKER_MT_CPANFILES
3335
export DOCKER_NODEJS_IMAGE
3436
export DOCKER_HTTPD_BUILD_CONTEXT
3537
export DOCKER_HTTPD_DOCKERFILE

mt/common.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414
NLS_LANG: ${NLS_LANG:-Japanese_Japan.UTF8}
1515
MT_DEV_UPDATE_BRANCH: ${UPDATE_BRANCH:-yes}
1616
DOCKER_MT_SERVICES: ${DOCKER_MT_SERVICES}
17+
DOCKER_MT_CPANFILES: ${DOCKER_MT_CPANFILES}
1718
APACHE_LOG_DIR: ${APACHE_LOG_DIR:-/tmp/apache2/log}
1819
APACHE_PID_FILE: ${APACHE_PID_FILE:-/tmp/apache2/run/apache2.pid}
1920
volumes:

mt/docker-entrypoint.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
#!/bin/sh
22

3+
[ "$(id -u)" -eq 0 ] && SUDO= || SUDO=sudo
4+
35
if [ -n "$DOCKER_MT_SERVICES" ]; then
46
for s in $DOCKER_MT_SERVICES; do
5-
service $s start
7+
$SUDO service $s start
8+
done
9+
fi
10+
11+
if [ -n "$DOCKER_MT_CPANFILES" ]; then
12+
for f in $DOCKER_MT_CPANFILES; do
13+
if [ -f $f ]; then
14+
$SUDO cpm install -g --cpanfile=$f
15+
fi
616
done
717
fi
818

9-
chmod 777 /var/www/html
10-
chmod 777 /var/www/cgi-bin/mt/mt-static/support
11-
chmod 777 /var/www/cgi-bin/mt/themes
19+
$SUDO chmod 777 /var/www/html
20+
$SUDO chmod 777 /var/www/cgi-bin/mt/mt-static/support
21+
$SUDO chmod 777 /var/www/cgi-bin/mt/themes
1222

1323
if [ "$1" = "apache2-foreground" ]; then
1424
# invoke php-fpm

0 commit comments

Comments
 (0)