docker-compose

How to assign domain names to containers in Docker?

大城市里の小女人 提交于 2019-12-20 08:37:30
问题 I am reading a lot these days about how to setup and run a docker stack. But one of the things I am always missing out on is how to setup that particular containers respond to access through their domain name and not just their container name using docker dns. What I mean is, that say I have a microservice which is accessible externally, for example: users.mycompany.com, it will go through to the microservice container which is handling the users api Then when I try to access the customer

Custom nginx container exits immediately when part of docker-compose

风格不统一 提交于 2019-12-20 08:37:28
问题 I'm trying to learn how to use docker compose with a simple setup of an nginx container that reroutes requests to a ghost container. I'm using the standard ghost image but have a custom nginx image (that inherits from the standard image). When I run the composition using "docker-compose up" it exits immediately with "docker_nginx_1 exited with code 0". However, when I build and run it manually, it runs fine and I can navigate my browser to the container and view the default nginx page. What

Using docker-compose to create tables in postgresql database

£可爱£侵袭症+ 提交于 2019-12-20 08:20:14
问题 I am using docker-compose to deploy a multicontainer python Flask web application. I'm having difficulty understanding how to create tables in the postgresql database during the build so I don't have to add them manually with psql. My docker-compose.yml file is: web: restart: always build: ./web expose: - "8000" links: - postgres:postgres volumes: - /usr/src/flask-app/static env_file: .env command: /usr/local/bin/gunicorn -w 2 -b :8000 app:app nginx: restart: always build: ./nginx/ ports: -

docker-compose up for only certain containers

好久不见. 提交于 2019-12-20 08:14:31
问题 I have a docker-compose.yml which contain several containers. Three of them are for my app (client, server and database) and the rest are for various dev tools (e.g. psql, npm, manage.py, etc). When I do docker-compose up all of them are started, but I only want the three main ones to start. Because of the links I've specified, I can start just those three with docker-compose up client but then the output is only from that one container. So, is there a way to do one of the following: Tell

docker-compose up for only certain containers

孤街醉人 提交于 2019-12-20 08:14:08
问题 I have a docker-compose.yml which contain several containers. Three of them are for my app (client, server and database) and the rest are for various dev tools (e.g. psql, npm, manage.py, etc). When I do docker-compose up all of them are started, but I only want the three main ones to start. Because of the links I've specified, I can start just those three with docker-compose up client but then the output is only from that one container. So, is there a way to do one of the following: Tell

docker-compose up for only certain containers

不羁岁月 提交于 2019-12-20 08:14:04
问题 I have a docker-compose.yml which contain several containers. Three of them are for my app (client, server and database) and the rest are for various dev tools (e.g. psql, npm, manage.py, etc). When I do docker-compose up all of them are started, but I only want the three main ones to start. Because of the links I've specified, I can start just those three with docker-compose up client but then the output is only from that one container. So, is there a way to do one of the following: Tell

Can't connect to docker from docker-compose

自闭症网瘾萝莉.ら 提交于 2019-12-20 08:01:22
问题 I installed docker-machine 0.1.0 and docker-compose 1.1.0 on Mac OS 10.8.5. Docker-machine is running normally and able to connect by docker-machine ssh. $ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM dev * virtualbox Running tcp://192.168.99.100:2376 However can't connect from docker-compose. $ docker-compose up Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment

How to rebuild docker container in docker-compose.yml?

非 Y 不嫁゛ 提交于 2019-12-20 07:58:54
问题 There are scope of services which defined in docker-compose.yml. These service have been started. I need to rebuild only one of these and start it without up other services. I run the following commands: docker-compose up -d # run all services docker-compose stop nginx # stop only one. but it still running !!! docker-compose build --no-cache nginx docker-compose up -d --no-deps # link nginx to other services At the end i got old nginx container. By the way docker-compose doesn't kill all

docker compose inside docker in a docker

孤人 提交于 2019-12-20 07:28:38
问题 I am pretty new to docker and was following the documentation found here, trying deploy several containers inside dind using docker-compose 1.14.0 I get the following docker run -v /home/dudarev/compose/:/compose/ --privileged docker:dind /compose/docker-compose /usr/local/bin/dockerd-entrypoint.sh: exec: line 21: /compose/docker-compose: not found Did I miss something? 回答1: Add docker-compose installation to your Dockerfile before executing docker run. For example, if you have an Ubuntu

Accessing local SQS service from another docker container using environment variables

巧了我就是萌 提交于 2019-12-20 07:10:58
问题 I have a flask application which needs to interact with an SQS service whenever an endpoint is hit. I'm mimicing the SQS service locally using docker image sukumarporeddy/sqs:fp whose base image is https://github.com/vsouza/docker-SQS-local with two more queues added in configuration. I need to access this service from another app which is run as app_service . These two services are run using docker-compose.yml file where I mentioned two services. app_service sqs_service While building the