Intention:
I am trying to figure out how to use the command docker-compose up --build
to build a machine with an Apache/PHP7.1 service acting as a web server and a MSSQL service as the database for the app that is served from the web server.
I need to be able to type in commands to the docker container while I build this development environment (so that I can look at the PHP logs, etc), but since the web server is running, my terminal is occupied with the output from the web server and when I press ctrl+Z
, it actually puts the docker process in the background.
The question: Is there anyway that I can run this docker-compose.yml file and have it drop me into the shell on the guest machine?
Service 1:
webserver:
image: php:7.1-apache
stdin_open: true
tty: true
volumes:
- ./www:/var/www/html
ports:
- 5001:80
Service 2:
mssql:
image: microsoft/mssql-server-linux
stdin_open: true
tty: true
environment:
- ACCEPT_EULA=Y
volumes:
- ./www:/var/www/html
ports:
- 1433:1433
depends_on:
-webserver