Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Update readme and increment version (#7)
Browse files Browse the repository at this point in the history
This updates the README to include more usage information, and
the Acorn disclaimer section.

Additionally, this also bumps the LTS version from 10.11.5 to 10.11.6

Signed-off-by: Bill Maxwell <[email protected]>
  • Loading branch information
cloudnautique authored Jan 17, 2024
1 parent b2c531c commit 57e83e8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Acornfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services: db: {
containers: mariadb: {
name: "MariaDB"
description: "Containerized MariaDB database server"
image: "mariadb:10.11.5" // Current LTS Version
image: "mariadb:10.11.6" // Current LTS Version
ports: "3306/tcp"
env: {
MARIADB_ROOT_PASSWORD: "@{secrets.admin.password}"
Expand Down
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,58 @@
This Acorn provides a MariaDB database through the Acorn service interface. You can use this Acorn to create a database for your application during development. This launches a single MariaDB container backed by a persistent volume.

The username and passwords for the `root` and `db_user` are randomly generated and stored in the Acorn's secret. The `db_user` is granted all privileges to the database created at startup. Updates to the `--db-name` and `--username` flags will not be applied to the database after the first run.

## Versioning

The version of this Acorn is the version of the MariaDB database server and the Acorn build number for that version. For example, `10.11.6-0` is MariaDB version `10.11.6` and Acorn build number `0`. If there is a breaking change related to the packaging of the Acorn, the Acorn build number will be incremented like so: `10.11.6-1.0`.

## Usage

The examples folder of this repository contains a sample application that uses this Acorn. The application is a simple Python Flask application that uses the MariaDB database to store and retrieve data.

To use this image, add the following to your Acornfile:

```acorn
...
services: db: image: "ghcr.io/acorn-io/mariadb:v#.#.#-#"
...
```

You can customize the database and username name by adding service args to the definition like so:

```acorn
...
services: db: {
image: "ghcr.io/acorn-io/mariadb:v#.#.#-#"
serviceArgs: {
dbName: "wp"
username: "wp_user"
}
}
...
```

To connect these services to your container, you can use the following settings:

```acorn
services: db: image: "ghcr.io/acorn-io/mariadb:v#.#.#-#"
containers: app: {
image: "nginx"
env: {
DB_HOST: "@{service.db.address}"
DB_PORT: "@{service.db.port.3306}"
DB_NAME: "@{service.db.data.dbName}"
DB_ADMIN_USER: "@{service.db.secrets.admin.username}"
DB_ADMIN_PASS: "@{service.db.secrets.admin.password}"
DB_USER: "@{service.db.secrets.user.username}"
DB_PASS: "@{service.db.secrets.user.password}"
}
}
```

The above environment variables are an example, you need to use the correct environment variables for your application.

## Disclaimer

Disclaimer: You agree all software products on this site, including Acorns or their contents, may contain projects and materials subject to intellectual property restrictions and/or Open-Source license (“Restricted Items”). Restricted Items found anywhere within this Acorn or on Acorn.io are provided “as-is” without warranty of any kind and are subject to their own Open-Source licenses and your compliance with such licenses are solely and exclusively your responsibility. [MariaDB](https://mariadb.org) is licensed under GPL-2.0 License which can be found here [License](https://mariadb.com/kb/en/licensing-faq/) and Acorn.io does not endorse and is not affiliated with MariaDB. By using Acorn.io you agree to our general disclaimer here: <https://www.acorn.io/terms-of-use>.
2 changes: 1 addition & 1 deletion examples/my-todo/Acornfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
services: db: image: "ghcr.io/acorn-io/mariadb:v#.#.#"
services: db: image: "ghcr.io/acorn-io/mariadb:v#.#.#-#"

containers: app: {
build: context: "."
Expand Down

0 comments on commit 57e83e8

Please sign in to comment.