From d99b2c6a570d88e51665ef685ea92fecf17a35fa Mon Sep 17 00:00:00 2001 From: LarsLemos Date: Mon, 18 Sep 2023 00:29:11 +0200 Subject: [PATCH 1/2] Updated folder for dev worklfow --- .env | 8 ++++ .github/workflows/ohri-dev.yml | 2 +- docker-compose-ohri-dev.yml | 73 +++++++++++++++++++++++++++++++++ docker-compose-ohri-working.yml | 73 +++++++++++++++++++++++++++++++++ docker-compose.stack.yml | 0 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 .env create mode 100644 docker-compose-ohri-dev.yml create mode 100644 docker-compose-ohri-working.yml create mode 100644 docker-compose.stack.yml diff --git a/.env b/.env new file mode 100644 index 000000000..b28e82c3b --- /dev/null +++ b/.env @@ -0,0 +1,8 @@ +# OpenMRS +OPENMRS_DB_USER=openmrs +OPENMRS_DB_PASSWORD=password +OPENMRS_USER=admin +OPENMRS_PASSWORD=Admin123 + +# MySQL +MYSQL_ROOT_PASSWORD=YOUR_PREFERRED_MYSQL_ROOT_PASSWORD diff --git a/.github/workflows/ohri-dev.yml b/.github/workflows/ohri-dev.yml index d8e02a366..b4d03f103 100644 --- a/.github/workflows/ohri-dev.yml +++ b/.github/workflows/ohri-dev.yml @@ -130,7 +130,7 @@ jobs: - name: Copy files to /home/runner/ run: | ls -la -t - cp -r $GITHUB_WORKSPACE/.ssh/ /home/runner/ + cp -r $GITHUB_WORKSPACE/github/.ssh/ /home/runner/ - name: List contents of /home/runner/ run: ls -la /home/runner/ diff --git a/docker-compose-ohri-dev.yml b/docker-compose-ohri-dev.yml new file mode 100644 index 000000000..f0c6048ad --- /dev/null +++ b/docker-compose-ohri-dev.yml @@ -0,0 +1,73 @@ +version: "3.7" + +services: + gateway: + image: histacoohri/ohri-dev-proxy:next + depends_on: + - frontend + - backend + ports: + - "8083:80" + # - "8083:8083" + + frontend: + image: histacoohri/ohri-dev-frontend:next + environment: + SPA_PATH: /openmrs/spa + API_URL: /openmrs + SPA_CONFIG_URLS: /openmrs/spa/ohri-config.json + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost/"] + timeout: 10s + depends_on: + - backend + # OHRI customizations + #volumes: + # - ./frontend/ohri-config.json:/usr/share/nginx/html/ohri-config.json + + backend: + image: histacoohri/ohri-dev-backend-2_6:next + depends_on: + - db + environment: + OMRS_CONFIG_MODULE_WEB_ADMIN: "true" + OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true" + OMRS_CONFIG_CREATE_TABLES: "true" + OMRS_CONFIG_CONNECTION_SERVER: db + OMRS_CONFIG_CONNECTION_DATABASE: openmrs + OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs} + OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs} + OMRS_JAVA_SERVER_OPTS: "-Dfile.encoding='UTF-8' -server -Xms1024m -Xmx6144m -Djava.security.egd='file:/dev/./urandom' -Djava.awt.headless='true' -Djava.awt.headlesslib='true'" + healthcheck: + disable: true + #test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"] + #timeout: 10s + volumes: + - ohri-openmrs-data:/openmrs/data + + # MariaDB + db: + image: mariadb:10.8.2 + command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci" + healthcheck: + test: 'mysql --user=${OMRS_DB_USER:-openmrs} --password=${OMRS_DB_PASSWORD:-openmrs} --execute "SHOW DATABASES;"' + interval: 10s + timeout: 5s + retries: 5 + environment: + MYSQL_DATABASE: openmrs + MYSQL_USER: ${OMRS_DB_USER:-openmrs} + MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs} + volumes: + - ohri-db-data:/var/lib/mysql + +volumes: + ohri-openmrs-data: ~ + ohri-db-data: ~ + + +networks: + default: + external: true + name: ohri \ No newline at end of file diff --git a/docker-compose-ohri-working.yml b/docker-compose-ohri-working.yml new file mode 100644 index 000000000..ab98fa5f0 --- /dev/null +++ b/docker-compose-ohri-working.yml @@ -0,0 +1,73 @@ +version: "3.7" + +services: + gateway: + image: histacoohri/ohri-working-proxy:next + depends_on: + - frontend + - backend + ports: + - "8083:80" + # - "8083:8083" + + frontend: + image: histacoohri/ohri-working-frontend:next + environment: + SPA_PATH: /openmrs/spa + API_URL: /openmrs + SPA_CONFIG_URLS: /openmrs/spa/ohri-config.json + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost/"] + timeout: 10s + depends_on: + - backend + # OHRI customizations + #volumes: + # - ./frontend/ohri-config.json:/usr/share/nginx/html/ohri-config.json + + backend: + image: histacoohri/ohri-working-backend-2_6:next + depends_on: + - db + environment: + OMRS_CONFIG_MODULE_WEB_ADMIN: "true" + OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true" + OMRS_CONFIG_CREATE_TABLES: "true" + OMRS_CONFIG_CONNECTION_SERVER: db + OMRS_CONFIG_CONNECTION_DATABASE: openmrs + OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs} + OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs} + OMRS_JAVA_SERVER_OPTS: "-Dfile.encoding='UTF-8' -server -Xms1024m -Xmx6144m -Djava.security.egd='file:/dev/./urandom' -Djava.awt.headless='true' -Djava.awt.headlesslib='true'" + healthcheck: + disable: true + #test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"] + #timeout: 10s + volumes: + - ohri-openmrs-data:/openmrs/data + + # MariaDB + db: + image: mariadb:10.8.2 + command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci" + healthcheck: + test: 'mysql --user=${OMRS_DB_USER:-openmrs} --password=${OMRS_DB_PASSWORD:-openmrs} --execute "SHOW DATABASES;"' + interval: 10s + timeout: 5s + retries: 5 + environment: + MYSQL_DATABASE: openmrs + MYSQL_USER: ${OMRS_DB_USER:-openmrs} + MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs} + volumes: + - ohri-db-data:/var/lib/mysql + +volumes: + ohri-openmrs-data: ~ + ohri-db-data: ~ + + +networks: + default: + external: true + name: ohri \ No newline at end of file diff --git a/docker-compose.stack.yml b/docker-compose.stack.yml new file mode 100644 index 000000000..e69de29bb From 17efd49cc25800336bc7bcbaa1b74634b2824bc4 Mon Sep 17 00:00:00 2001 From: LarsLemos Date: Mon, 18 Sep 2023 00:31:52 +0200 Subject: [PATCH 2/2] Updated folder for dev worklfow, fix hidden folder --- .github/workflows/ohri-dev.yml | 2 +- docker-compose-ohri-dev.yml | 14 ++------------ docker-compose-ohri-working.yml | 11 ++--------- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ohri-dev.yml b/.github/workflows/ohri-dev.yml index b4d03f103..f9019a1e8 100644 --- a/.github/workflows/ohri-dev.yml +++ b/.github/workflows/ohri-dev.yml @@ -130,7 +130,7 @@ jobs: - name: Copy files to /home/runner/ run: | ls -la -t - cp -r $GITHUB_WORKSPACE/github/.ssh/ /home/runner/ + cp -r $GITHUB_WORKSPACE/.github/ssh/ /home/runner/ - name: List contents of /home/runner/ run: ls -la /home/runner/ diff --git a/docker-compose-ohri-dev.yml b/docker-compose-ohri-dev.yml index f0c6048ad..2d2274886 100644 --- a/docker-compose-ohri-dev.yml +++ b/docker-compose-ohri-dev.yml @@ -7,8 +7,7 @@ services: - frontend - backend ports: - - "8083:80" - # - "8083:8083" + - "80:80" frontend: image: histacoohri/ohri-dev-frontend:next @@ -21,9 +20,6 @@ services: timeout: 10s depends_on: - backend - # OHRI customizations - #volumes: - # - ./frontend/ohri-config.json:/usr/share/nginx/html/ohri-config.json backend: image: histacoohri/ohri-dev-backend-2_6:next @@ -64,10 +60,4 @@ services: volumes: ohri-openmrs-data: ~ - ohri-db-data: ~ - - -networks: - default: - external: true - name: ohri \ No newline at end of file + ohri-db-data: ~ \ No newline at end of file diff --git a/docker-compose-ohri-working.yml b/docker-compose-ohri-working.yml index ab98fa5f0..4184e90c7 100644 --- a/docker-compose-ohri-working.yml +++ b/docker-compose-ohri-working.yml @@ -7,8 +7,7 @@ services: - frontend - backend ports: - - "8083:80" - # - "8083:8083" + - "80:80" frontend: image: histacoohri/ohri-working-frontend:next @@ -64,10 +63,4 @@ services: volumes: ohri-openmrs-data: ~ - ohri-db-data: ~ - - -networks: - default: - external: true - name: ohri \ No newline at end of file + ohri-db-data: ~ \ No newline at end of file