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

Commit

Permalink
Merge pull request #3 from cloudnautique/main
Browse files Browse the repository at this point in the history
Added Readme disclaimer updated image
  • Loading branch information
cloudnautique authored Jan 18, 2024
2 parents 7b62c15 + 544822d commit b8a6b8f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Acornfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs: setup: {
}

volumes: {
"db": {}
db: {}
}

secrets: {
Expand All @@ -79,7 +79,7 @@ localData: info: """
## Usage

services: db: {
image: "ghcr.io/lucj/acorn-couchbase:v#.#.#-#"
image: "ghcr.io/acorn-io/couchbase:v#.#.#-#"
}

containers: app: {
Expand Down
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Couchbase is a high-performance, distributed NoSQL database designed for large-s

This Acorn provides a Couchbase database as an Acorn Service. It can be used to easily get a Couchbase database for your application during development. The current service runs a single Couchbase container backed by a persistent volume and define credentials for an admin user.

The Acorn image of this service is hosted in GitHub container registry at [ghcr.io/acorn-io/couchbase](ghcr.io/acorn-io/couchbase).
The Acorn image of this service is hosted in GitHub container registry at [ghcr.io/acorn-io/couchbase](ghcr.io/acorn-io/couchbase).

Currently this Acorn has the following configuration options:

- *dbUser*: name of the admin user (empty by default)
- *clusterName*: name of the Couchbase cluster to create
- *bucketName*: name of the bucket to create inside the cluster
Expand All @@ -27,36 +28,36 @@ services: db: {

## Usage

The [examples folder](https://github.com/acorn-io/couchbase/tree/main/examples) contains a sample application using this Service. This app consists in a Python backend based on the FastAPI library, it displays a web page indicating the number of times the application was called, a counter is saved in the underlying Couchbase database and incremented with each request. The screenshot below shows the UI of the example application.
The [examples folder](https://github.com/acorn-io/couchbase/tree/main/examples) contains a sample application using this Service. This app consists in a Python backend based on the FastAPI library, it displays a web page indicating the number of times the application was called, a counter is saved in the underlying Couchbase database and incremented with each request. The screenshot below shows the UI of the example application.

![UI](./examples/images/ui.png)

To use the Couchbase Service, we first define a *service* property in the Acornfile of the application:

```
services: db: {
image: "ghcr.io/lucj/acorn-couchbase:v#.#.#-#"
image: "ghcr.io/acorn-io/acorn-couchbase:v#.#.#-#"
}
```

Next we define the application container. This one can connect to the Couchbase service via environment variables which values are set based on the service's properties.

```
containers: {
app: {
build: {
context: "."
target: "dev"
}
consumes: ["db"]
ports: publish: "8000/http"
env: {
CB_HOST: "@{service.db.address}"
CB_BUCKET: "@{service.db.data.bucketName}"
CB_USERNAME: "@{service.db.secrets.admin.username}"
CB_PASSWORD: "@{service.db.secrets.admin.password}"
}
}
app: {
build: {
context: "."
target: "dev"
}
consumes: ["db"]
ports: publish: "8000/http"
env: {
CB_HOST: "@{service.db.address}"
CB_BUCKET: "@{service.db.data.bucketName}"
CB_USERNAME: "@{service.db.secrets.admin.username}"
CB_PASSWORD: "@{service.db.secrets.admin.password}"
}
}
}
```

Expand All @@ -78,3 +79,6 @@ Instead of managing your own Acorn installation, you can deploy this application

An application running in the Sandbox will automatically shut down after 2 hours, but you can use the Acorn Pro plan to remove the time limit and gain additional functionalities.

## 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. [Couchbase](https://www.couchbase.com) is licensed depending on which server edition is being run. See the docs for more details on the [License](https://docs.couchbase.com/server/current/introduction/editions.html) and Acorn.io does not endorse and is not affiliated with Couchbase. 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/Acornfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services: db: {
acornfile: "../Acornfile"
}
} else {
image: "ghcr.io/lucj/acorn-couchbase:v#.#.#-#"
image: "ghcr.io/acorn-io/couchbase:v#.#.#-#"
}
}

Expand Down

0 comments on commit b8a6b8f

Please sign in to comment.