I want to use docker-compose to build together php and several databases (orientdb, neo4j, etc.). Then go into the php container and use the command to execute the commands.
Individually, all of my containers run smoothly, and when I put them together, they all run. However, I can’t understand for life how to save the php container so that I can enter it for testing.
For simplicity, I just use one database: orient-db.
My docker-compose.yml file:
version: '2' services: php: build: . links: - orientdb orientdb: image: orientdb:latest environment: ORIENTDB_ROOT_PASSWORD: rootpwd ports: - "2424:2424" - "2480:2480"
My "php" Dockerfile :
FROM php:5.6-cli ADD . /spider WORKDIR /spider RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer RUN composer install --prefer-source --no-interaction RUN yes | pecl install xdebug \ && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini
I tried (by the way):
docker-compose up in one terminal and then docker attach in another- including
tty and stdin_open in my layout file - using the command
/bin/bash - options
CMD exec vendor/bin/phpunit -D FOREGROUND
And some links that I tried: - How to save the Docker container after starting the services? - https://github.com/docker/compose/issues/1926 - https://github.com/docker/compose/issues/423
Any help would be really appreciated.
Thanks.
php docker docker-compose provisioning orientdb
Apollo
source share