docker-compose

docker-compose scaling with unique environment variable

和自甴很熟 提交于 2020-04-16 04:05:30
问题 I have a sample compute service in my docker-compose file which works just great as expected. version: "3" services: compute-service: image: dummy/compute environment: - INPUT=2 However there could be times in which I need to run this service with diff inputs (say INPUT = 4, 7, 9, 10, 12..etc). I do not like the idea of copying and pasting the service multiple times for each input. Scaling is an option. But how can I ensure that each instance works on unique input variable. I am aware that I

Why a angular container needs a exposed port to connect?

不问归期 提交于 2020-04-16 02:55:06
问题 this is just a question about theory, my app is running perfectly... So, I have 3 services runing with docker-compose: a postgres database , a backend springboot and a frontend angular . From what I know, docker containers can acess ports from other docker containers without the need to expose the port, so there is no need to expose nor bind the ports because they are all containers and can access each other with the default bridge network mode (that's what I learned, don't know if this is

Enable Authentication in elasticsearch with docker environment variable

依然范特西╮ 提交于 2020-04-14 21:05:13
问题 I would like to ask how will I be able to enable authentication (x-pack). In my case I am using docker image of elasticsearch v.6.2.4. My problem is that xpack is installed but it is not asking for credentials. Thank you for your help! I know that xpack is installed because of this in my kibana enter image description here 回答1: Enable Security in Elasticsearch using docker Update the environment variables t enable true environment: - "discovery.type=single-node" - ELASTICSEARCH_USERNAME

What is the best way to debug an app deployed to Kubernetes locally using Docker Desktop?

こ雲淡風輕ζ 提交于 2020-04-14 07:48:08
问题 I have experience using Docker to develop a relatively complex application. It is very easy to debug an app using Visual Studio (2019). I just set docker-compose.yaml as the startup app and start debugging. Is it possible to debug an application that is published to Kubernetes locally using Docker Desktop? By debug I mean set breakpoints etc? I have spent a few hours Googling this and I have got nowhere and hence the reason for the question. Please note that I am not asking how to debug an

docker-compose - ADD failed: Forbidden path outside the build context

时光怂恿深爱的人放手 提交于 2020-04-13 05:44:52
问题 I have such folder structure project - config -docker Dockerfile docker-compose.yml - src here_is_code requirements.txt Dockerfile FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD ../../requirements.txt /code/ RUN pip install -r requirements.txt ADD src /code/ docker-compose.yml version: '3' services: web: build: context: ../../ dockerfile: config/docker/Dockerfile command: bash -c "ls" volumes: - .:/code expose: - "8000" nginx: image: nginx ports: - "8000:8000" volumes:

Use nodemon with docker and docker-compose

瘦欲@ 提交于 2020-04-12 06:17:34
问题 I'm using nodemon with docker-compose. Here is my Dockerfile: FROM node:10 WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . . CMD ["npm", "start"] My docker-compose.yml version: '3' services: app: build: . volumes: - .:/usr/src/app - /usr/src/app/node_modules container_name: docker-node-mongo restart: always ports: - 3000:3000 - 9229:9229 command: npm start links: - mongo - redis mongo: container_name: mongo image: mongo ports: - "27017:27017" redis: image: redis:alpine

pg_dump issue in docker

柔情痞子 提交于 2020-04-11 06:27:53
问题 Here is my dockerfile and here is my docker-compose file. When I ran docker-compose run web rake db:migrate I got this err rake aborted! failed to execute: pg_dump -s -x -O -f /usr/src/app/db/structure.sql --schema=public --schema=partitioning docker_rails_dev Please check the output above for any errors and make sure that `pg_dump` is installed in your PATH and has proper permissions. /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/tasks/postgresql_database_tasks.rb:90:in `run

pg_dump issue in docker

半世苍凉 提交于 2020-04-11 06:26:07
问题 Here is my dockerfile and here is my docker-compose file. When I ran docker-compose run web rake db:migrate I got this err rake aborted! failed to execute: pg_dump -s -x -O -f /usr/src/app/db/structure.sql --schema=public --schema=partitioning docker_rails_dev Please check the output above for any errors and make sure that `pg_dump` is installed in your PATH and has proper permissions. /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/tasks/postgresql_database_tasks.rb:90:in `run

Docker-compose exclude service by default

两盒软妹~` 提交于 2020-04-10 04:00:30
问题 If I have a great many services defined in a docker-compose project, how can I exclude a service from the default docker-compose up command? For example, I have an nginx service, and an ssl service. They conflict because they both consume port 80, so how can I make it so that the ssl service doesn't start unless I specifically run that service, and by default the up command will do everything EXCEPT the ssl service? 回答1: Not exactly what you're looking for but you could use the scale flag to

How do I run the same docker-compose.yml several times on same docker daemon with different names?

本秂侑毒 提交于 2020-04-08 18:45:50
问题 My situation. Trying to run a docker-compose structure several times on the same box. This is my docker-compose.yml : version: '3' services: code: image: organization:java-maven links: - mysql:mysql volumes: - "${PWD}:/home/ubuntu/src" mysql: image: organization:mysql Running this twice with docker-compose run code mvn clean test creates two containers of code and one container of mysql . Now, I want one code to be linked to one mysql , and another code linked to another mysql . How do I