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









share|improve this question






















  • 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















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









share|improve this question






















  • 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













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









share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin