Docker composer and volume
up vote
0
down vote
favorite
I have generated a docker yml file with necessary images. I have placed index.php in the current directory which is required by nginx to display the page and when i run docker-compose up command, no files from my working directory detected in /application directory from container.
version: "2"
services:
memcached:
image: memcached:alpine
container_name: juzpay-docker-memcached
mysql:
image: mysql:8.0
container_name: juzpay-docker-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=juzpay_db
- MYSQL_USER=root
- MYSQL_PASSWORD=root123
ports:
- "8082:3306"
webserver:
image: nginx:alpine
container_name: juzpay-docker-webserver
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
php-fpm:
build: phpdocker/php-fpm
container_name: juzpay-docker-php-fpm
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
docker docker-compose dockerfile
add a comment |
up vote
0
down vote
favorite
I have generated a docker yml file with necessary images. I have placed index.php in the current directory which is required by nginx to display the page and when i run docker-compose up command, no files from my working directory detected in /application directory from container.
version: "2"
services:
memcached:
image: memcached:alpine
container_name: juzpay-docker-memcached
mysql:
image: mysql:8.0
container_name: juzpay-docker-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=juzpay_db
- MYSQL_USER=root
- MYSQL_PASSWORD=root123
ports:
- "8082:3306"
webserver:
image: nginx:alpine
container_name: juzpay-docker-webserver
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
php-fpm:
build: phpdocker/php-fpm
container_name: juzpay-docker-php-fpm
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
docker docker-compose dockerfile
You can create a persistent volume and use this for you're Docker-Stack.
– Igelaty
4 hours ago
According to this line- ./dockerapp:/application
you are not mounting your current directory (I'm assuming root of the project) into your container.
– gasc
13 mins ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have generated a docker yml file with necessary images. I have placed index.php in the current directory which is required by nginx to display the page and when i run docker-compose up command, no files from my working directory detected in /application directory from container.
version: "2"
services:
memcached:
image: memcached:alpine
container_name: juzpay-docker-memcached
mysql:
image: mysql:8.0
container_name: juzpay-docker-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=juzpay_db
- MYSQL_USER=root
- MYSQL_PASSWORD=root123
ports:
- "8082:3306"
webserver:
image: nginx:alpine
container_name: juzpay-docker-webserver
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
php-fpm:
build: phpdocker/php-fpm
container_name: juzpay-docker-php-fpm
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
docker docker-compose dockerfile
I have generated a docker yml file with necessary images. I have placed index.php in the current directory which is required by nginx to display the page and when i run docker-compose up command, no files from my working directory detected in /application directory from container.
version: "2"
services:
memcached:
image: memcached:alpine
container_name: juzpay-docker-memcached
mysql:
image: mysql:8.0
container_name: juzpay-docker-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=juzpay_db
- MYSQL_USER=root
- MYSQL_PASSWORD=root123
ports:
- "8082:3306"
webserver:
image: nginx:alpine
container_name: juzpay-docker-webserver
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
php-fpm:
build: phpdocker/php-fpm
container_name: juzpay-docker-php-fpm
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
docker docker-compose dockerfile
docker docker-compose dockerfile
asked 4 hours ago
Ry Van
607
607
You can create a persistent volume and use this for you're Docker-Stack.
– Igelaty
4 hours ago
According to this line- ./dockerapp:/application
you are not mounting your current directory (I'm assuming root of the project) into your container.
– gasc
13 mins ago
add a comment |
You can create a persistent volume and use this for you're Docker-Stack.
– Igelaty
4 hours ago
According to this line- ./dockerapp:/application
you are not mounting your current directory (I'm assuming root of the project) into your container.
– gasc
13 mins ago
You can create a persistent volume and use this for you're Docker-Stack.
– Igelaty
4 hours ago
You can create a persistent volume and use this for you're Docker-Stack.
– Igelaty
4 hours ago
According to this line
- ./dockerapp:/application
you are not mounting your current directory (I'm assuming root of the project) into your container.– gasc
13 mins ago
According to this line
- ./dockerapp:/application
you are not mounting your current directory (I'm assuming root of the project) into your container.– gasc
13 mins ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53349372%2fdocker-composer-and-volume%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can create a persistent volume and use this for you're Docker-Stack.
– Igelaty
4 hours ago
According to this line
- ./dockerapp:/application
you are not mounting your current directory (I'm assuming root of the project) into your container.– gasc
13 mins ago