Skip to content

Commit

Permalink
KH-512: Add reports redirect and back up docker compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
enyachoke committed Jul 1, 2024
1 parent 8b8ca89 commit 1d28684
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 2 deletions.
49 changes: 47 additions & 2 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,52 @@
</resources>
</configuration>
</execution>

<execution>
<!-- Copy over the Docker Compose override file -->
<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>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<!-- Copy over the Docker Compose override file -->
<id>Copy backup.docker-compose.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>backup.docker-compose.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

Expand Down Expand Up @@ -278,4 +323,4 @@
</build>
</profile>
</profiles> -->
</project>
</project>
51 changes: 51 additions & 0 deletions base/scripts/backup.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "3.7"

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-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:
8 changes: 8 additions & 0 deletions base/scripts/docker-compose-reports-redirect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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 1d28684

Please sign in to comment.