-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- docker-compose.*.yml を追加 - docker-compose.<DB_TYPE>.yml を指定した場合で data/config/config.phpが存在しない場合は自動インストールされるよう修正 - docker-compose.dev.yml を指定した場合はローカル環境をマウントするよう修正
- Loading branch information
Showing
8 changed files
with
156 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3' | ||
|
||
services: | ||
ec-cube: | ||
volumes: | ||
- ".:/var/www/app:delegated" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: '3' | ||
|
||
volumes: | ||
mysql-database: | ||
driver: local | ||
|
||
services: | ||
ec-cube: | ||
command: apache2-foreground | ||
entrypoint: /wait-for-mysql.sh | ||
depends_on: | ||
- mysql | ||
environment: | ||
TZ: Asia/Tokyo | ||
PHP_POST_MAX_SIZE: 10M | ||
PHP_UPLOAD_MAX_FILESIZE: 10M | ||
PHP_LOG_ERRORS: "On" | ||
PHP_ERROR_REPORTING: "E_ALL" | ||
PHP_ERROR_LOG: "/proc/self/fd/2" | ||
# EC-CUBE2 Config | ||
HTTP_URL: https://localhost:4430/ | ||
HTTPS_URL: https://localhost:4430/ | ||
ROOT_URLPATH: / | ||
DOMAIN_NAME: ~ | ||
DB_TYPE: mysql | ||
DB_USER: eccube_db_user | ||
DB_PASSWORD: password | ||
DB_SERVER: mysql | ||
DB_NAME: eccube_db | ||
DB_PORT: ~ | ||
ADMIN_DIR: admin/ | ||
ADMIN_FORCE_SSL: 'false' | ||
ADMIN_ALLOW_HOSTS: 'a:0:{}' | ||
AUTH_MAGIC: ~ | ||
PASSWORD_HASH_ALGOS: sha256 | ||
|
||
mysql: | ||
image: mysql:5.7 | ||
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci | ||
ports: | ||
- '13306:3306' | ||
volumes: | ||
- mysql-database:/var/lib/mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: eccube_db | ||
MYSQL_USER: eccube_db_user | ||
MYSQL_PASSWORD: password | ||
networks: | ||
- backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: '3' | ||
|
||
volumes: | ||
pg-database: | ||
driver: local | ||
|
||
services: | ||
ec-cube: | ||
command: apache2-foreground | ||
entrypoint: /wait-for-pgsql.sh | ||
depends_on: | ||
- postgres | ||
environment: | ||
TZ: Asia/Tokyo | ||
PHP_POST_MAX_SIZE: 10M | ||
PHP_UPLOAD_MAX_FILESIZE: 10M | ||
PHP_LOG_ERRORS: "On" | ||
PHP_ERROR_REPORTING: "E_ALL" | ||
PHP_ERROR_LOG: "/proc/self/fd/2" | ||
# EC-CUBE2 Config | ||
HTTP_URL: https://localhost:4430/ | ||
HTTPS_URL: https://localhost:4430/ | ||
ROOT_URLPATH: / | ||
DOMAIN_NAME: ~ | ||
DB_TYPE: pgsql | ||
DB_USER: eccube_db_user | ||
DB_PASSWORD: password | ||
DB_SERVER: postgres | ||
DB_NAME: eccube_db | ||
DB_PORT: 5432 | ||
ADMIN_DIR: admin/ | ||
ADMIN_FORCE_SSL: 'false' | ||
ADMIN_ALLOW_HOSTS: 'a:0:{}' | ||
AUTH_MAGIC: ~ | ||
PASSWORD_HASH_ALGOS: sha256 | ||
|
||
postgres: | ||
image: postgres | ||
environment: | ||
- POSTGRES_DB=eccube_db | ||
- POSTGRES_USER=eccube_db_user | ||
- POSTGRES_PASSWORD=password | ||
ports: | ||
- 15432:5432 | ||
volumes: | ||
- pg-database:/var/lib/postgresql/data | ||
networks: | ||
- backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
order allow,deny | ||
deny from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Waiting for mysql" | ||
until mysql -h "${DB_SERVER}" --password="${MYSQL_ROOT_PASSWORD}" -uroot &> /dev/null | ||
do | ||
printf "." | ||
sleep 1 | ||
done | ||
|
||
>&2 echo "MySQL Ready" | ||
|
||
if [ ! -f /var/www/app/data/config/config.php ] | ||
then | ||
echo "Install to ec-cube" | ||
DBUSER=$DB_USER DBPASS=$DB_PASSWORD DBNAME=$DB_NAME DBPORT=$DB_PORT DBSERVER=$DB_SERVER /var/www/app/eccube_install.sh mysql | ||
fi | ||
|
||
exec docker-php-entrypoint "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
export PGPASSWORD=$DB_PASSWORD | ||
until psql -h "${DB_SERVER}" -U "${DB_USER}" -d "template1" -c '\l'; do | ||
>&2 echo "Postgres is unavailable - sleeping" | ||
printf "." | ||
sleep 1 | ||
done | ||
|
||
>&2 echo "Postgres is up - executing command" | ||
|
||
if [ ! -f /var/www/app/data/config/config.php ] | ||
then | ||
echo "Install to ec-cube" | ||
DBUSER=$DB_USER DBPASS=$DB_PASSWORD DBNAME=$DB_NAME DBPORT=$DB_PORT DBSERVER=$DB_SERVER /var/www/app/eccube_install.sh pgsql | ||
fi | ||
|
||
exec docker-php-entrypoint "$@" |