docker-compose

How to debug processes running inside docker-compose with pycharm

家住魔仙堡 提交于 2020-05-28 12:44:30
问题 I'm trying to switch my local Pycharm + Django to docker based dev env. I run on mac and use Docker-Compose (few dockers: my django app, some db and nginx). All runs fine, code change immediately reflected in docker and correct packages available while coding in Pycharm. Once docker-compose started, a list of running containers is shown in Pycharm's docker plugin window, for each container i can see its log/properties/port/volume bindings. Interpreter seems to be configured properly with

docker-compose scale with separate volumes

六眼飞鱼酱① 提交于 2020-05-26 09:39:10
问题 I would like to use scale but I need different volumes and port mapping for each node. How can I do that? Ideally I would need some kind of environment variable or a script that is run to allocate a volume and ports for each new instance. What is the recommended way to do this? 回答1: I am aware that this might not be a perfect solution but if you don't mind sharing data between nodes.. it does work well. I am using this for local tests so it is safe in my case. Docker-compose.yml ... volumes:

docker-compose scale with separate volumes

半世苍凉 提交于 2020-05-26 09:38:31
问题 I would like to use scale but I need different volumes and port mapping for each node. How can I do that? Ideally I would need some kind of environment variable or a script that is run to allocate a volume and ports for each new instance. What is the recommended way to do this? 回答1: I am aware that this might not be a perfect solution but if you don't mind sharing data between nodes.. it does work well. I am using this for local tests so it is safe in my case. Docker-compose.yml ... volumes:

Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432?

落花浮王杯 提交于 2020-05-25 21:12:11
问题 I am getting issues while setup and run the docker instance on my local system with Ruby on Rail. Please see my docker configuration files:- Dockerfile FROM ruby:2.3.1 RUN useradd -ms /bin/bash web RUN apt-get update -qq && apt-get install -y build-essential RUN apt-get -y install nginx RUN apt-get -y install sudo # for postgres RUN apt-get install -y libpq-dev # for nokogiri RUN apt-get install -y libxml2-dev libxslt1-dev # for a JS runtime RUN apt-get install -y nodejs RUN apt-get update #

docker-compose build environment variable

 ̄綄美尐妖づ 提交于 2020-05-25 12:07:46
问题 TL;DR : How can I pass env variable when building the image with docker-compose and have docker run image command recognize them ? I have this Dockerfile : FROM mhart/alpine-node:10 ADD . /app WORKDIR /app RUN apk --no-cache add --virtual builds-deps build-base python &&\ yarn global add nodemon &&\ yarn &&\ apk del builds-deps build-base python and this docker-compose.yml : version: "3.3" services: api: build: context: . dockerfile: Dockerfile-preprod image: registry.git.louis-girones.fr

Unable to access docker-compose containers created inside docker

强颜欢笑 提交于 2020-05-25 06:11:56
问题 I have a docker-compose.yml file that starts up a simple HTTP echo service on port 8800 . version: '2' services: echo-server: image: luisbebop/echo-server container_name: echo-server ports: - "8800:8800" Super simple stuff. If I run docker-compose up and run on my local machine: echo "Hello World" | nc 127.0.0.1 8800 Then I see the echo. However: If I run this same compose scenario inside a docker container, through the GitLab runner, it fails. I've tried to garner attention for this issue at

docker volume custom mount point [duplicate]

我们两清 提交于 2020-05-24 08:31:27
问题 This question already has answers here : Docker: change folder where to store docker volumes (2 answers) Closed 3 years ago . I'm new to Docker and I was playing around with docker volume . I wanted to specify the location where docker volume stores the data. Much like when we provide the -v option when we execute docker run . Ex : -v /somefolder/:/var/somefolder How can we set a custom Mountpoint when we create a docker volume . I didn't find any options on docs. When I inspect the volume [

Docker container not hot-reloading Angular

社会主义新天地 提交于 2020-05-23 11:45:19
问题 I'm configuring a dockerized Angular app but when i modify something, the page does not refresh automatically as it does on my local setup. Based on this: Docker container doesn't reload Angular app I should expose port 49153 but this does not work. Here's my configuration: Dockerfile FROM node:14-slim RUN npm install @angular/cli@latest -g RUN mkdir -p /home/boilerplate WORKDIR /home/boilerplate EXPOSE 4200 49153 CMD ng serve --port 4200 --poll 1 docker-compose.yaml version: "3" services:

Docker container not hot-reloading Angular

a 夏天 提交于 2020-05-23 11:44:05
问题 I'm configuring a dockerized Angular app but when i modify something, the page does not refresh automatically as it does on my local setup. Based on this: Docker container doesn't reload Angular app I should expose port 49153 but this does not work. Here's my configuration: Dockerfile FROM node:14-slim RUN npm install @angular/cli@latest -g RUN mkdir -p /home/boilerplate WORKDIR /home/boilerplate EXPOSE 4200 49153 CMD ng serve --port 4200 --poll 1 docker-compose.yaml version: "3" services:

Use docker-compose env variable in Dockerbuild file

試著忘記壹切 提交于 2020-05-23 01:55:30
问题 Having the following docker-compose file: db: build: . environment: - MYSQL_ROOT_PASSWORD=password - ENV=test env_file: .env Is there any way to use the env variables declared in docker-compose.yml (either as environment or declared in the env_file) as part of Dockerfile without declaring them in the Dockerfile? Something like this: FROM java:7 ADD ${ENV}/data.xml /data/ CMD ["run.sh"] 回答1: Although this question was asked long ago, there is an answer to a similar question here: Pass