Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose ファイルを分割する #4955

Merged
merged 5 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ EXPOSE 443
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Override with custom configuration settings
COPY dockerbuild/php.ini $PHP_INI_DIR/conf.d/
COPY dockerbuild/docker-php-entrypoint /usr/local/bin/

RUN chown www-data:www-data /var/www \
&& mkdir -p ${APACHE_DOCUMENT_ROOT}/vendor \
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'

services:
ec-cube:
volumes:
- ".:/var/www/html:cached"
27 changes: 27 additions & 0 deletions docker-compose.mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'

volumes:
mysql-database:
driver: local

services:
ec-cube:
depends_on:
- mysql
environment:
DATABASE_URL: "mysql://dbuser:secret@mysql/eccubedb"
DATABASE_SERVER_VERSION: 10

mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccubedb
MYSQL_USER: dbuser
MYSQL_PASSWORD: secret
volumes:
- mysql-database:/var/lib/mysql
ports:
- 13306:3306
networks:
- backend
File renamed without changes.
26 changes: 26 additions & 0 deletions docker-compose.pgsql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'

volumes:
pg-database:
driver: local

services:
ec-cube:
depends_on:
- postgres
environment:
DATABASE_URL: "postgres://dbuser:secret@postgres/eccubedb"
DATABASE_SERVER_VERSION: 10

postgres:
image: postgres:10
environment:
POSTGRES_DB: eccubedb
POSTGRES_USER: dbuser
POSTGRES_PASSWORD: secret
ports:
- 15432:5432
volumes:
- pg-database:/var/lib/postgresql/data
networks:
- backend
54 changes: 21 additions & 33 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ networks:
driver: bridge

volumes:
pg-database:
driver: local
mysql-database:
driver: local
mailcatcher-data:
driver: local

Expand All @@ -33,40 +29,32 @@ services:
- 8080:80
- 4430:443
volumes:
- ".:/var/www/html:cached"
### 同期対象からコストの重いフォルダを除外 #####################
- "var:/var/www/html/var"
- "vendor:/var/www/html/vendor"
- "node_modules:/var/www/html/node_modules"
networks:
- backend

### Postgres ################################
postgres:
image: postgres:10
environment:
- POSTGRES_DB=eccubedb
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=secret
ports:
- 15432:5432
volumes:
- pg-database:/var/lib/postgresql/data
networks:
- backend

### MySQL ##################################
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccubedb
MYSQL_USER: dbuser
MYSQL_PASSWORD: secret
volumes:
- mysql-database:/var/lib/mysql
ports:
- 13306:3306
# EC-CUBE environments
APP_ENV: "dev"
APP_DEBUG: 1
DATABASE_URL: "sqlite:///var/eccube.db"
DATABASE_SERVER_VERSION: 3
MAILER_URL: "smtp://mailcatcher:1025"
ECCUBE_AUTH_MAGIC: "<change.me>"
# ECCUBE_LOCALE: "ja"
# ECCUBE_TIMEZONE: "Asia/Tokyo"
# ECCUBE_CURRENCY: "JPY"
# ECCUBE_ADMIN_ROUTE: "admin"
# ECCUBE_USER_DATA_ROUTE: "user_data"
# ECCUBE_ADMIN_ALLOW_HOSTS: []
# ECCUBE_FORCE_SSL: false
# ECCUBE_TEMPLATE_CODE: "default"
# ECCUBE_COOKIE_NAME: "eccube"
# ECCUBE_COOKIE_PATH: "/"
# ECCUBE_COOKIE_LIFETIME: 0
# ECCUBE_GC_MAXLIFETIME: 1440
# ECCUBE_ADMIN_USER: "admin"
# ECCUBE_ADMIN_PASS: "password"
networks:
- backend

Expand Down
13 changes: 13 additions & 0 deletions dockerbuild/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

if [ -n "${APP_ENV}" ]; then
echo "SetEnv APP_ENV ${APP_ENV}" >> /etc/apache2/conf-enabled/app_env.conf
fi

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
fi

exec "$@"
1 change: 1 addition & 0 deletions dockerbuild/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ opcache.max_accelerated_files = 20000
opcache.memory_consumption=256
realpath_cache_size = 4096K
realpath_cache_ttl = 600
memory_limit = 786M