This helper script is used to build and install an 'app-only' version of the
package onto the local system. This is intendend to be used on the VM as a way
to quickly test new updates to the configuration files using images already
available on the system. This is MUCH faster than packaging with images.
The updated statistics image now pulls data from the database once per day, but
attempts to upload hourly to prevent large delays due to poor network
connectivity.
Previously, two volumes were bound to the statistics service. Both are removed
here. The first volume was a .env file, whose contents are now moved to the
compose file under the 'environment' keyword. The second, enabling persistent
storage for the /app folder, also caused the crucial 'fetch_and_update.php' to
be overwritten. Persistent storage is not currently necessary within this
service.
- Named volumes were still present (but unused) from a previous commit.
- A network was explicitly defined, but was not necessary as all services are
added to a default bridge network already.
- Remove host port mapping for redis container as the statistics service
accesses it directly (not through the host). This is also improves security.
This modified script replaces adds a wait condition on startup before attempting
to interact with the database. This is done with 'mariadb-admin ping' run in a
loop at 1s intervals, ultimately timing out after 30s if unsuccessful. Other
minor updates to the script print additional info the docker logs during
startup.
v2.0 was built using a demo database that should not have been present. v2.1
uses the same application, but should start with a clean database. This change
bumps the version to 2.1 and resets the database if the currently installed
version is 1.* or 2.0.
The script `install.sh` largely copies the template from the hosted-app-utils
project, with some key changes:
1. replace template parameters (`{{VAR}}`) with hard-coded values
2. define variables for org, app, install root, etc
3. if old version detected, remove data folder before installing update
The modified script will:
1. delete v1 data
2. update normally when v2 or newer installations are present
The wkhtmltopdf library does not work with the latest version of alpine. To
workaround this, a known working image based on an older alpine image is pulled
in and relevant libraries copied to the target image.
The `snappy` package required a few updates to support this, including setting
the wkhtmltopdf binary path explicitly and to enable access to local files
(disabled by default).
The table `gender_based_violences` was missing a `triage_id` field, causing an
exception to occur in some cases when selecting the triage button. This change
alters the schema of the table to ensure the column is always present.
The latest images incorporate all changes previously added by the dockerfiles.
The arm image however is still missing/unreliable from the registry and must be
built independently.
Two bugs are fixed by this commit. First, a typo in the format string used write
resource usage data to the systemlog caused the systemlog to (correctly) reject
the string as invalid json. The second fix is to handle a case where a .env file
is present, but does not define the APP_CONTAINER variable. In this case the
container name is left empty. This is not an immediate issue, but would become
problematic in the future if additional containers were to be added.
While 7 is the default number of characters used to abbreviate a commit hash,
this is not (by default) constant and different instances of the same repo may
generate different version strings as a result. This commit sets this length
explicitly to 7 in both package.sh and build-image scripts.
An updated set of source files and initialization was provided by streamline to
address issues observed during initial testing. These files have been updated in
order to generate a new set of app images.
The notion of application "instances" is dropped in favor of a simpler,
single-instance approach. Default values are provided for all configuration
variables so allow the app to run without additional manual configuration.
A health check and auto-heal script are added to automatically restart the
application in case it becomes unavailable during operation.
- compress images with xz by default (and decompress on install)
- add help menu and command line argument parsing to package.sh
- display packaging status if `pv` command available
The official image from streamline does not currently work for the arm64
platform. As a temporary measure, the source code and docker build scripts
have been lifted from the official images and are used to build locally.
Some additional modifications are made to reduce overall image size, these
are documented in docker/README.md