docker-compose

How to use custom Nginx config for official nginx Docker image?

痴心易碎 提交于 2019-12-10 17:11:44
问题 I have next docker-compose file: nginx: build: . ports: - "80:80" - "443:443" links: - fpm fpm: image: php:fpm ports: - "9000:9000" The Dockerfile command list is: FROM nginx ADD ./index.php /usr/share/nginx/html/ # Change Nginx config here... The Nginx server work fine and I can see default html page on http://localhost/index.html , but don't execute PHP scripts. So when I get http://localhost/index.php - browser download PHP file instead of execute them. How can I use custom Nginx config to

Is it possible to create container in multiple host using a single docker compose file?

依然范特西╮ 提交于 2019-12-10 16:57:26
问题 I have to create containers in multiple host. I have a dockerfile for each container. I found that docker-compose can be used to run multiple containers from a single yaml file. I have to run containerA in HostA, containerB in HostB and so on.. is it possible to achieve this using docker-compose ? or what is the best way to create container in different host using the dockerfile. 回答1: No, docker-compose alone won't achieve this. Managing containers across multiple hosts is generally the job

How to make an nginx reverse-proxy load balance between two docker containers?

眉间皱痕 提交于 2019-12-10 16:36:00
问题 I try to make an nginx reverse proxy load balance between two containers with the same nodejs app. The directory structure: . +-- docker-compose.yml +-- nginx +-- nodejs | +-- index.js | +-- … +-- php docker-compose.yml: version: "3.1" services: nginx-proxy: image: nginx:alpine ports: - "8000:80" volumes: - ./nginx/default.conf:/etc/nginx/conf.d/default.conf links: - php:php-app - nodejs:nodejs-app nodejs: image: node:alpine environment: NODE_ENV: production working_dir: /home/app restart:

RabbitMq refuses connection when run in docker

喜你入骨 提交于 2019-12-10 15:54:59
问题 My docker-compose file looks like this: version: '2' services: explore: image: explore build: context: ./Explore dockerfile: VsDockerfile environment: - "ElasticUrl=http://localhost:9200" - "RabbitMq/Host=localhost" - "RabbitMq/Username=guest" - "RabbitMq/Password=guest" networks: - localnet elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:5.4.3 container_name: elasticsearch environment: - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ports: - 9200:9200 volumes: - ./esdata:/usr/share

Using xdebug through Docker container in PhpStorm

a 夏天 提交于 2019-12-10 15:46:14
问题 I've read some posts about this but none helped in my case or simply overlooked the missing piece. I cannot get xdebug to work on PhpStorm using a Docker container. Docker-compose.yml version: '2' services: web: image: nginx:latest volumes: - .:/usr/share/nginx/html - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/logs:/var/logs/nginx - ./nginx/site-enabled/default.conf:/etc/nginx/sites-enabled/default.conf ports: - "80:80" depends_on: - php db: image: mysql:5.7 environment: MYSQL_ROOT

Issue with docker compose: container command not found

有些话、适合烂在心里 提交于 2019-12-10 15:17:03
问题 I'm having an issue when trying to start multiple containers with docker-compose: Dockerfile: FROM nginx:1.9 ADD ./nginx-sites/default /etc/nginx/sites-available/default docker-compose.yml: version: "2" services: web: build: . ports: - "80:80" volumes: - ./src:/var/www links: - fpm fpm: image: php:7-fpm volumes: - ./src:/var/www When I use docker-compose up to start the application, I get the following error: ERROR: Container command not found or does not exist. Would love some help with this

Docker, Volumes vs Bind Mounts for persistent data such as DB, elasticsearch?

放肆的年华 提交于 2019-12-10 15:16:33
问题 docker data volume vs mounted host directory says volumes should be preferred over bind mounts I have a few questions regarding the issue. The post says: When you create a volume, it is stored within a directory on the Docker host Bear with me, but I'm new to docker, and I'm wondering what is docker host here. Is it a machine where I build the image (probably not)? Is it the machine where the image will be run? If it is so, what happens if I run the image on multiple machines, will it create

Getting forbidden error while using nginx inside docker

烈酒焚心 提交于 2019-12-10 14:47:09
问题 My Docker file contents are FROM nginx COPY /src /usr/share/nginx/html My docker compose file contents are version: '2' services: app: build: . image: app:1.0.0 volumes: - ./src:/usr/share/nginx/html ports: - "8080:80" I'm getting following error when run docker-compose *1 directory index of "/usr/share/nginx/html/" is forbidden I tried giving permission to directory -> /usr/share/nginx/html it didn't work. I want to sync host directory with docker container. 回答1: I was facing the same issue

Docker compose error “In file './docker-compose.yml', service 'punjab' must be a mapping not a string.”

◇◆丶佛笑我妖孽 提交于 2019-12-10 13:39:37
问题 I am getting a strange error in my docker-compose.yml file. I have prepared a docker-compose file for the stack punjab connection manager, ejabberd and mysql. Below is the docker-compose.yml file version: '2' services: punjab: image:punjab ports - 5280:5280 links - ejabbberd:ejabberd ejabberd: image: ejabberd depends-on: - mysql links: - mysql:mysql mysql: image:mysql When I run the command docker-compose up from the command line and from the same directory where I have the docker-compose.yml