Skip to content

Commit

Permalink
[docker] improved docker configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kilip committed Nov 8, 2018
1 parent fc35b06 commit ecd007d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
9 changes: 4 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"
services:
nginx:
image: nginx:alpine
container_name: yawik.nginx
container_name: ${DOCKER_CONTAINER_NAME}.nginx
volumes:
- ./etc/docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./:/var/www/yawik
Expand All @@ -15,15 +15,14 @@ services:
- UMASK="0000"

php:
container_name: yawik.php
container_name: ${DOCKER_CONTAINER_NAME}.php
env_file:
- .env
build:
context: etc/docker/php
args:
TIMEZONE: ${TIMEZONE}
volumes:
- ./etc/docker/php/php-ini-overrides.ini:/usr/local/etc/php/conf.d/99-overrides.ini
- ./:/var/www/yawik
links:
- mongo
Expand All @@ -32,12 +31,12 @@ services:

mongo:
image: mongo:3.4.10
container_name: yawik.mongo
container_name: ${DOCKER_CONTAINER_NAME}.mongo
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
volumes:
- ./var/mongodb:/data/db
- ./etc/docker/mongodb/data:/data/db
ports:
- "27017:27017"
command: mongod --smallfiles --logpath=/dev/null # --quiet
1 change: 1 addition & 0 deletions etc/docker/mongodb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/data
1 change: 1 addition & 0 deletions etc/docker/php/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/php-ini-overrides.ini
15 changes: 13 additions & 2 deletions etc/docker/php/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
#!/bin/sh
set -e

echo $PWD
PHP_INI_OVERRIDE="etc/docker/php/php-ini-overrides.ini"
if [ ! -f ${PHP_INI_OVERRIDE} ]; then
# just using default configuration
PHP_INI_OVERRIDE="etc/docker/php/php-ini-overrides.ini.dist";
fi

TARGET=/usr/local/etc/php/conf.d/99-overrides.ini
cp -v ${PHP_INI_OVERRIDE} ${TARGET}

export DOCKER_ENV="yes"

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

# start selenium server
#./bin/start-selenium > /dev/null 2>&1 &
./bin/console clear-cache
umask 0000
chmod 777 var/cache -Rf
chmod 777 var/log -Rf
Expand Down
6 changes: 3 additions & 3 deletions etc/docker/php/php-ini-overrides.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
upload_max_filesize = 10000M
post_max_size = 10008M
xdebug.remote_host="172.23.0.1"
xdebug.remote_host="172.30.0.1"
xdebug.remote_port=9001
xdebug.idekey=PHPSTORM
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.idekey=PHPSTORM
8 changes: 8 additions & 0 deletions etc/docker/php/php-ini-overrides.ini.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
upload_max_filesize = 10000M
post_max_size = 10008M
xdebug.remote_host="172.23.0.1"
xdebug.remote_port=9001
xdebug.idekey=PHPSTORM
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1

0 comments on commit ecd007d

Please sign in to comment.