docker-compose

Using Docker Compose to expose DDEV web container ports to host machine

落花浮王杯 提交于 2021-02-10 14:47:50
问题 I have configured a DDEV Drupal environment in which I need to run Pattern Lab for my theme. This environment will be used by students of mine who may not be well-versed in installing Node or Node dependencies tools on their local computers (Pattern Lab requires Node). As a workaround, I am setting Pattern Lab to run in the DDEV's web container. The problem I am having is that since Pattern Lab is running in a DDEV container, I can't access it on my host computer. Has anyone done something

Access running docker container filesystem

纵饮孤独 提交于 2021-02-10 14:17:18
问题 I am developing a WordPress theme and set up the development environment using docker. My docker-compose.yml volume property looks like this; volumes: - ~/WordPress/wp-content:/var/www/html/wp-content it mounts just the wp-content directory to the local machine. I now have to edit wp-config file which is in /var/www/html/ the docker image container. Can anyone here show me how to access and edit the wp-config file in the running docker container? 回答1: You can run a shell terminal in the

docker-compose + django + redis - Error 111 connecting to 127.0.0.1:6379. Connection refused

一曲冷凌霜 提交于 2021-02-10 07:39:28
问题 I've looked through this answer and can't figure out how to apply it to my problem, so if the answer is there, clarification would be appreciated. I'm also a noob to docker and docker-compose. I have a simple docker-compose.yml version: '3' services: redis: image: "redis:alpine" web: build: . # current directory command: bash -c "python /app/src/manage.py migrate && python /app/src/manage.py runserver 0.0.0.0:8000" volumes: - .:/app ports: - "8000:8000" When I run this with: docker-compose up

Docker compose file ownership

你。 提交于 2021-02-09 11:58:08
问题 I created Django project with Docker Compose: Dockerfile FROM python:2.7 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD . /code/ RUN pip install -r requirements.txt WORKDIR /code/example ENTRYPOINT ["python", "manage.py"] docker-compose.yml postgres: image: postgres ports: - '5432:5432' django-project: build: . command: runserver 0.0.0.0:8000 volumes: - .:/code ports: - '8000:8000' links: - postgres It work nice. But all new files which create through container 'django-project' have

Docker- nginx -Reverse proxy : host not found in upstream when building with docker-compose

徘徊边缘 提交于 2021-02-09 06:58:19
问题 I am using NGINX container to redirect certain requests to another container.While running docker-compose up -d , i am getting bellow error. " 2019/09/26 18:05:00 [emerg] 1#1: host not found in upstream "abcplus-visualize:61613" in /etc/nginx/nginx.conf:10 nginx: [emerg] host not found in upstream "abcplus-visualize:61613" in /etc/nginx/nginx.conf:10 " below is my docker-compose.yml file version: '2' services: reverseproxy: image: reverseproxy ports: - 49665:2181 restart: always abcplus

Docker Compose cannot connect to database

烂漫一生 提交于 2021-02-08 18:28:59
问题 I'm using nestjs for my backend and using typeorm as ORM. I tried to define my database and my application in an docker-compose file. If I'm running my database as a container and my application from my local machine it works well. My program connects and creates the tables etc. But if I try to connect the database from within my container or to start the container with docker-compose up it fails. Always get an ECONNREFUSED Error. Where is my mistake ? docker-compose.yml version: '3.1'

Docker Compose cannot connect to database

China☆狼群 提交于 2021-02-08 18:28:43
问题 I'm using nestjs for my backend and using typeorm as ORM. I tried to define my database and my application in an docker-compose file. If I'm running my database as a container and my application from my local machine it works well. My program connects and creates the tables etc. But if I try to connect the database from within my container or to start the container with docker-compose up it fails. Always get an ECONNREFUSED Error. Where is my mistake ? docker-compose.yml version: '3.1'

Stopping Apache2 is much slower when overriding ENTRYPOINT in Docker

こ雲淡風輕ζ 提交于 2021-02-08 10:53:35
问题 I'm containerizing a PHP application and would like to modify the Apache configuration based on environment variables. This is done in a script overriding the default ENTRYPOINT : FROM php:7.2-apache # ... COPY prepare-docker-configs.sh . RUN chmod +x prepare-docker-configs.sh ENTRYPOINT ./prepare-docker-configs.sh After those modifications, Apache doesn't start. apache2-foreground seems to be the missing command, so I run it at the end of prepare-docker-configs.sh #!/bin/bash # ... Some

Stopping Apache2 is much slower when overriding ENTRYPOINT in Docker

末鹿安然 提交于 2021-02-08 10:52:09
问题 I'm containerizing a PHP application and would like to modify the Apache configuration based on environment variables. This is done in a script overriding the default ENTRYPOINT : FROM php:7.2-apache # ... COPY prepare-docker-configs.sh . RUN chmod +x prepare-docker-configs.sh ENTRYPOINT ./prepare-docker-configs.sh After those modifications, Apache doesn't start. apache2-foreground seems to be the missing command, so I run it at the end of prepare-docker-configs.sh #!/bin/bash # ... Some

Issue with docker compose initial DB setup once

余生长醉 提交于 2021-02-08 09:47:49
问题 I have created Docker file which looks like this db: image: postgres:10.3 ports: - "5432:5432" environment: POSTGRES_DB: test POSTGRES_USER: test POSTGRES_PASSWORD: changeme restart: always volumes: - ./srv/postgres:/var/lib/postgresql/data - ./init/:/docker-entrypoint-initdb.d/ I have a sql script in ./init path which have sql commands to create database and user. I see the sql file created in the postgres container but somehow it is not executing. I have followed the documentation on the