Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can use the SDK to generate the docker-compose files.

 


Option 3 - Running MySQL and OpenMRS using direct docker-compose

...

Code Block
languageyml
themeEclipse
titledocker-compose.yml
linenumberstrue
version: '2.1'

services:
  openmrs-referenceapplication-mysql:
    restart: "always"
    image: mysql:5.6
    command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci"
    environment:
      MYSQL_DATABASE: ${MYSQL_DB:-openmrs}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-Admin123}
      MYSQL_USER: ${MYSQL_USER:-openmrs}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD:-Admin123}
    ports:
      - "3306:3306"
    healthcheck:
      test: "exit 0"
    volumes:
      - openmrs-referenceapplication-mysql-data:/var/lib/mysql

  openmrs-referenceapplication:
    restart: "always"
    image: openmrs/openmrs-reference-application-distro:demo
    depends_on:
      - openmrs-referenceapplication-mysql
    ports:
      - "8080:8080"
    environment:
      DB_DATABASE: ${MYSQL_DB:-openmrs}
      DB_HOST: openmrs-referenceapplication-mysql
      DB_USERNAME: ${MYSQL_USER:-openmrs}
      DB_PASSWORD: ${MYSQL_PASSWORD:-Admin123}
      DB_CREATE_TABLES: 'true'
      DB_AUTO_UPDATE: 'true'
      MODULE_WEB_ADMIN: 'true'
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs/"]
      timeout: 20s
    volumes:
      - openmrs-referenceapplication-data:/usr/local/tomcat/.OpenMRS/
      - /usr/local/tomcat/.OpenMRS/modules/ # do not store modules in data
      - /usr/local/tomcat/.OpenMRS/owa/ # do not store owa in data

volumes:
   openmrs-referenceapplication-mysql-data:
   openmrs-referenceapplication-data:

  • OpenMRS Platform version 2.2 and below should run on image: mysql:5.6
  • OpenMRS Platform version 2.3 and above should run on image: mysql:5.7

Make sure you have a docker-compose.yml file on the current directory:

...