How to connect to concrete database in docker-compose

Advertisements I have next setup of docker-compose.yaml name: test-app-to-delete services: mongo: image: mongo restart: always networks: – mongo volumes: – db:/data/db:rw environment: MONGO_INITDB_ROOT_USERNAME: ‘user’ MONGO_INITDB_ROOT_PASSWORD: ‘password’ MONGO_INITDB_DATABASE: ‘db-name’ mongo-express: image: mongo-express restart: always networks: – mongo ports: – 8081:8081 environment: ME_CONFIG_MONGODB_ADMINUSERNAME: user ME_CONFIG_MONGODB_ADMINPASSWORD: password ME_CONFIG_MONGODB_URL: mongodb://user:password@mongo:27017/db-name networks: mongo: volumes: db: So issue become a problem… Read More How to connect to concrete database in docker-compose

Network communication between containers in different Docker Compose applications running simultaneously

Advertisements Is there any way that a container X in docker-compose application A can communicate with a container Y in docker-compose application B, both running simultaneously. I wish to deliver my application as a docker-compose.yml file. This is docker-compose application A. The application requires that certain databases exist. In production, clients must provide these database… Read More Network communication between containers in different Docker Compose applications running simultaneously

Does it matter if the docker compose file is named docker-compose.yml or compose.yml?

Advertisements Looking at examples for docker compose files I found some named "compose.y(a)ml" instead of "docker compose.yml" or "docker-compose.yml" that I’ve seen. Does it matter if it’s "compose." or "docker composer"? Awesome Compose repo I’ve tried to search for an answer online and tried reading on the docker documentation here but didn’t figure it out.… Read More Does it matter if the docker compose file is named docker-compose.yml or compose.yml?

How dockerize Spring Boot app if Postgres db is going to be AWS RDS?

Advertisements version: "3.7" services: api_service: build: . restart: always ports: – 8080:8080 depends_on: – postgres_db links: – postgres_db:database postgres_db: image: "postgres:11.4" restart: always ports: – 5435:5432 environment: POSTGRES_DB: testDb POSTGRES_PASSWORD: admin this is my yaml and I got properties spring.datasource.platform=postgres spring.datasource.url=jdbc:postgresql://database:5432/testDb spring.datasource.username=postgres spring.datasource.password=admin if my postgres is rds then do I need to compose them… Read More How dockerize Spring Boot app if Postgres db is going to be AWS RDS?

Running docker-compose up -d -build , I got the following error:

Advertisements The Compose file ‘.\docker-compose.yml’ is invalid because: services.mysql.networks contains an invalid type, it should be an array, or an object this is the code: mysql: image: mysql:5.7.29 container_name: mysql restart: unless-stopped tty: true ports: – "3306:3306" environment: MYSQL_DATABASE: laravel MYSQL_USER: homestead MYSQL_PASSWORD: secret MYSQL_ROOT_PASSWORD: secret SERVICE_TAGS: dev SERVICE_NAME: mysql networks: -backend >Solution : You… Read More Running docker-compose up -d -build , I got the following error: