version: '2'
volumes:
database_data:
driver: local
services:
nginx:
image: nginx:latest
ports:
- 8080:80
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
volumes_from:
- php
php:
build: ./docker/php/
expose:
- 9000
volumes:
- .:/var/www/html
environment:
XDEBUG_CONFIG: remote_host=192.168.1.40
PHP_IDE_CONFIG: "serverName=nginx.local"
mysql:
image: mysql:latest
command: --disable-partition-engine-check
ports:
- 3306:3306
expose:
- 3306
environment:
MYSQL_ROOT_PASSWORD: blablabla
MYSQL_DATABASE: blablabla_db
MYSQL_USER: blablabla
MYSQL_PASSWORD: blablabla
volumes:
- database_data:/var/lib/mysql
composer:
build: ./docker/composer/
volumes:
- .:/app
FROM php:7-alpine
RUN apk --no-cache add curl git subversion openssh openssl mercurial tini bash zlib-dev
RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" \
&& echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini"
RUN docker-php-ext-install zip
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV COMPOSER_VERSION 1.6.3
RUN curl -s -f -L -o /tmp/installer.php https://raw.githubusercontent.com/composer/getcomposer.org/b107d959a5924af895807021fcef4ffec5a76aa9/web/installer \
&& php -r " \
\$signature = '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061'; \
\$hash = hash('SHA384', file_get_contents('/tmp/installer.php')); \
if (!hash_equals(\$signature, \$hash)) { \
unlink('/tmp/installer.php'); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit(1); \
}" \
&& php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \
&& composer --ansi --version --no-interaction \
&& rm -rf /tmp/* /tmp/.htaccess
COPY docker-entrypoint.sh /docker-entrypoint.sh
WORKDIR /app
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["composer"]
And i did create the docker-entrypoint.sh inside same directory.
D:\Projects\php\manufactory>docker-compose up
Creating manufactory_php_1 ... done
Creating manufactory_composer_1 ...
Creating manufactory_nginx_1 ... done
Creating manufactory_mysql_1 ...
Creating manufactory_mysql_1 ... done
Attaching to manufactory_composer_1, manufactory_php_1, manufactory_nginx_1, manufactory_mysql_1
composer_1 | standard_init_linux.go:195: exec user process caused "exec format error"
php_1 | Failed loading /wherever/you/put/it/xdebug.so: /wherever/you/put/it/xdebug.so: cannot open shared object file
: No such file or directory
php_1 | [14-Feb-2018 10:18:41] NOTICE: fpm is running, pid 1
php_1 | [14-Feb-2018 10:18:41] NOTICE: ready to handle connections
manufactory_composer_1 exited with code 1
mysql_1 | Traceback (most recent call last):
File "docker-compose", line 6, in <module>
File "compose\cli\main.py", line 71, in main
File "compose\cli\main.py", line 124, in perform_command
File "compose\cli\main.py", line 975, in up
File "compose\cli\log_printer.py", line 105, in run
File "compose\cli\log_printer.py", line 109, in write
File "codecs.py", line 370, in write
File "site-packages\colorama\ansitowin32.py", line 40, in write
File "site-packages\colorama\ansitowin32.py", line 141, in write
File "site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
File "site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
IOError: [Errno 0] Error
Failed to execute script docker-compose