Skip to content

Commit

Permalink
KH-512: Add reports redirect and back up docker compose files (#362)
Browse files Browse the repository at this point in the history
* KH-512: Add reports redirect and back up docker compose files

* Address review

* Copy files in single execution step

* Add commend tor reports redirect

* Update base/scripts/docker-compose-reports-redirect.yml

Co-authored-by: Romain Buisson <[email protected]>

* Update base/scripts/docker-compose-reports-redirect.yml

Co-authored-by: Romain Buisson <[email protected]>

---------

Co-authored-by: Romain Buisson <[email protected]>
  • Loading branch information
enyachoke and rbuisson authored Jul 1, 2024
1 parent 8ce890f commit 1a80a7f
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 2 deletions.
27 changes: 25 additions & 2 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,30 @@
</resources>
</configuration>
</execution>

<execution>
<!-- Copy over the reports redirect and backup files-->
<id>Copy docker-compose-reports-redirect.yml</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/${project.artifactId}-${project.version}/run/docker/
</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${project.basedir}/scripts</directory>
<includes>
<include>docker-compose-reports-redirect.yml</include>
<include>backup.docker-compose.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

Expand Down Expand Up @@ -278,4 +301,4 @@
</build>
</profile>
</profiles> -->
</project>
</project>
52 changes: 52 additions & 0 deletions base/scripts/backup.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
services:
create-backup-folder:
image: busybox:latest
command: ["sh", "-c", "mkdir -p /mnt/$$BACKUP_FOLDER"]
environment:
BACKUP_FOLDER: ${BACKUP_FOLDER}
volumes:
- "${BACKUP_PATH:-backup-path}:/mnt"
#
# MySQL backups
#
openmrs-db-backup:
image: mekomsolutions/mysql_backup:48d0823
depends_on:
create-backup-folder:
condition: service_completed_successfully
environment:
DB_HOST: 172.17.0.1
DB_NAME: openmrs
DB_USERNAME: ${OPENMRS_DB_USER}
DB_PASSWORD: ${OPENMRS_DB_PASSWORD}
BACKUP_PATH: "/opt/backup/${BACKUP_FOLDER}"
networks:
ozone:
aliases:
- openmrs-db-backup
volumes:
- "${BACKUP_PATH:-backup-path}:/opt/backup/"
#
# OpenMRS Initializer backups
#
openmrs-checksum-backup:
image: mekomsolutions/filestore_backup:48d0823
depends_on:
create-backup-folder:
condition: service_completed_successfully
environment:
FILESTORE_PATH: /mnt/openmrs_config_checksum
BACKUP_PATH: "/opt/backup/${BACKUP_FOLDER}"
FILENAME: openmrs-checksum
volumes:
- "${BACKUP_PATH:-backup-path}:/opt/backup/"
- "${OPENMRS_CONFIG_CHECKSUMS_PATH:-openmrs-config-checksums}:/mnt/openmrs_config_checksum"

volumes:
backup-path: ~
odoo-filestore: ~
odoo-checksums: ~
openmrs-config-checksums: ~

networks:
ozone:
11 changes: 11 additions & 0 deletions base/scripts/docker-compose-reports-redirect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Needed to redirect <domain>/reports to a separate Superset instance accessible via AWS domain name
#
services:
frontend:
labels:
traefik.http.routers.reports.rule: "Host(`${O3_HOSTNAME}`) && PathPrefix(`/reports`)"
traefik.http.routers.reports.entrypoints: "websecure"
traefik.http.routers.reports.middlewares: reports-redirectregex
traefik.http.middlewares.reports-redirectregex.redirectregex.regex: https://${O3_HOSTNAME}/reports
traefik.http.middlewares.reports-redirectregex.redirectregex.replacement: https://${SUPERSET_HOSTNAME}

0 comments on commit 1a80a7f

Please sign in to comment.