Hi everyone! I am new docker user. I want to use it to install OpenMRS(web application). The application uses tomcat and mysql. I have mange to create a tomcat container and mysql container, and they are running separately. I have read about the docker-compose and try to create a yaml file but when I run it I keep getting an error :
ERROR: yaml.parser.ParserError: while parsing a block mapping
in “./cdci.yaml”, line 1, column 1
expected , but found ‘’
in “./cdci.yaml”, line 18, column 3
I am using
OS: Ubuntu 22.04 LTS server
docker-compose version 1.29.2, build unknown
After creating the yaml file I have use " sudo docker-compose -f cdci.yaml up" to run the file
Bellow is the yaml file
version: ‘3.9’
services:
openmrs-mysql:
restart: “always”
image: mysql/mysql-server:5.6.44
container_name: mysql_docker
ports:
- “3306:3306”
environment:
MYSQL_DATABASE: ${MYSQL_DB:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-ifakara2023}
MYSQL_USER: ${MYSQL_USER:-openmrs}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-Admin123}
volumes:
- openmrs-mysql:/var/lib/mysql
openmrs-tomcat:
image: saravak/tomcat8:latest
container_name: tomcat_docker
depend_on:
-openmrs_mysql
ports:
-“8080:8080”
environment:
DB_DATABASE: ${MYSQL_DB:-openmrs}
DB_HOST: openmrs-mysql
DB_USERNAME: ${MYSQL_USER:-openmrs}
DB_PASSWORD: ${MYSQL_PASSWORD:-Admin123}
DB_CREATE_TABLES: ‘true’
DB_AUTO_UPDATE: ‘true’
MODULE_WEB_ADMIN: ‘true’
volumes:
- openmrs-tomcat-data:/usr/local/tomcat/.OpenMRS/
“cdci.yaml” 41L, 1090B 11,42 Top