I am trying to test this in my environment. In the DOCKER-compose.yml file i see the below listed :
version: ‘3.8’
services:
database:
image: ‘postgres:latest’
ports:
- 5455:5432
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
What is the use of setting the environment variable in the above container ?
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
Are we saying that if any other container wants to access database to write information to it he would be using the above user name and password?
What is the Volume section here ? What it does ?
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
artifactory-server:
image: ‘anushas/artifactory-server:local’
ports:
- 8080:8080
mock-identity-system:
image: ‘mosipid/mock-identity-system:0.9.2’
user: root
ports:
- 8082:8082
environment:
- artifactory_url_env=http://artifactory-server:8080/
- container_user=mosip
- active_profile_env=default
- SPRING_CONFIG_NAME=mock-identity-system
- SPRING_CONFIG_LOCATION=/home/mosip/mock-identity-system-default.properties
depends_on:
- database
- artifactory-server
volumes:
- ./config/mock-identity-system-default.properties:/home/mosip/mock-identity-system-default.properties
What is the use Environment variable here and volumes here ? I just want to understand how below environment variable and volume would help us ?
environment:
- artifactory_url_env=http://artifactory-server:8080/
- container_user=mosip
- active_profile_env=default
- SPRING_CONFIG_NAME=mock-identity-system
- SPRING_CONFIG_LOCATION=/home/mosip/mock-identity-system-default.properties
volumes:
- ./config/mock-identity-system-default.properties:/home/mosip/mock-identity-system-default.properties