docker-compose

django.db.utils.OperationalError: (2002, “Can't connect to MySQL server on 'db' (115)”)

僤鯓⒐⒋嵵緔 提交于 2020-12-10 04:28:19
问题 This has already been asked, but none of the answers have helped me. This is my configuration. Im running docker-compose with two services, a web app in django and the database in mariadb. I can connect normally to my local db with this exact configuration, only changing the host in settings.py to localhost. When i run docker-compose up , the web service stops immediately after trying to connect to the database, and return this error. django.db.utils.OperationalError: (2002, "Can't connect to

Mysql client called with `docker-compose run` vs. `docker-compose exec`

为君一笑 提交于 2020-12-08 15:56:38
问题 Why do you need to specify a host when calling with docker-compose run ? e.g. docker-compose run db_container mysql -uuser -ppass db_name -h db_container seems to be the direct equivalent of docker-compose exec db_container mysql -uuser -ppass db_name When omitting the hostname flag from the first example, mysql fails with a "can't connect to socket" error. What is the difference between the two examples? 回答1: docker-compose run will start a new container on the same network with a name like

Mysql client called with `docker-compose run` vs. `docker-compose exec`

对着背影说爱祢 提交于 2020-12-08 15:51:08
问题 Why do you need to specify a host when calling with docker-compose run ? e.g. docker-compose run db_container mysql -uuser -ppass db_name -h db_container seems to be the direct equivalent of docker-compose exec db_container mysql -uuser -ppass db_name When omitting the hostname flag from the first example, mysql fails with a "can't connect to socket" error. What is the difference between the two examples? 回答1: docker-compose run will start a new container on the same network with a name like

Docker-Compose: How to healthcheck OpenJDK:8 container?

给你一囗甜甜゛ 提交于 2020-12-06 16:48:58
问题 I'm trying to healthcheck a container that extends openjdk:8 . The corresponding Dockerfile can be found at https://github.com/jhipster/jhipster-registry/blob/master/Dockerfile I have the following directory structure: test/ ├── central-server-config │ └── application.yml ├── docker-compose.yml ├── jhipster-registry.yml └── Ping.jar application.yml #common configuration shared between all applications configserver: name: Docker JHipster Registry status: Connected to the JHipster Registry

Docker-Compose: How to healthcheck OpenJDK:8 container?

让人想犯罪 __ 提交于 2020-12-06 16:44:13
问题 I'm trying to healthcheck a container that extends openjdk:8 . The corresponding Dockerfile can be found at https://github.com/jhipster/jhipster-registry/blob/master/Dockerfile I have the following directory structure: test/ ├── central-server-config │ └── application.yml ├── docker-compose.yml ├── jhipster-registry.yml └── Ping.jar application.yml #common configuration shared between all applications configserver: name: Docker JHipster Registry status: Connected to the JHipster Registry

Docker-compose port range forward

对着背影说爱祢 提交于 2020-12-06 06:50:08
问题 The documentation is really lacking here. ports: - "20000-20100" works fine for one port (just "20000" does not work tho. It seemingly binds to a random port above 40k somewhere), but I can't find a reliable way to forward a range of ports instead of just one. - "20000-20100" - "10000-10100:20000-20100" - "20000-20100:20000-20100" None of these works I have also exposed 20000-30000 in the Dockerfile, but I'm under impression that this shouldn't really matter. Am I being stupid here? This

docker-compose - externalize spring application.properties

强颜欢笑 提交于 2020-12-05 17:51:23
问题 I have a spring boot application that connects to a mongo db and deployed the app with docker. I am using this docker-compose.yml file, which works fine: version: '2' services: db: container_name: app-db image: mongo volumes: - /data/db:/data/db ports: - 27017:27017 web: container_name: spring-app image: spring-app depends_on: - db environment: SPRING_DATA_MONGODB_URI: mongodb://db:27017/appDB SPRING_DATA_MONGODB_HOST: db ports: - 8080:8080 Currently, the app is using the application

docker-compose - externalize spring application.properties

♀尐吖头ヾ 提交于 2020-12-05 17:46:19
问题 I have a spring boot application that connects to a mongo db and deployed the app with docker. I am using this docker-compose.yml file, which works fine: version: '2' services: db: container_name: app-db image: mongo volumes: - /data/db:/data/db ports: - 27017:27017 web: container_name: spring-app image: spring-app depends_on: - db environment: SPRING_DATA_MONGODB_URI: mongodb://db:27017/appDB SPRING_DATA_MONGODB_HOST: db ports: - 8080:8080 Currently, the app is using the application

docker-compose - externalize spring application.properties

落花浮王杯 提交于 2020-12-05 17:41:07
问题 I have a spring boot application that connects to a mongo db and deployed the app with docker. I am using this docker-compose.yml file, which works fine: version: '2' services: db: container_name: app-db image: mongo volumes: - /data/db:/data/db ports: - 27017:27017 web: container_name: spring-app image: spring-app depends_on: - db environment: SPRING_DATA_MONGODB_URI: mongodb://db:27017/appDB SPRING_DATA_MONGODB_HOST: db ports: - 8080:8080 Currently, the app is using the application

Node.js docker container not updating to changes in volume

天大地大妈咪最大 提交于 2020-12-05 11:38:24
问题 I am trying to host a development environment on my Windows machine which hosts a frontend and backend container. So far I have only been working on the backend. All files are on the C Drive which is shared via Docker Desktop. I have the following docker-compose file and Dockerfile, the latter is inside a directory called backend within the root directory. Dockerfile: FROM node:12.15.0-alpine WORKDIR /usr/app COPY package*.json ./ RUN npm install EXPOSE 5000 CMD [ "npm", "start" ] docker