This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAcornfile
76 lines (64 loc) · 1.66 KB
/
Acornfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: "External Postgres Server"
description: "Provides an Acorn service for an externally hosted Postgres server."
readme: "./README.md"
info: localData.info
services: postgres: {
generated: job: "create"
default: true
}
jobs: create: {
image: "alpine"
env: {
"secret://config": ""
}
dirs: {
"/acorn/scripts": "./scripts"
}
entrypoint: ["/acorn/scripts/render.sh"]
}
secrets: admin: {
type: "generated"
params: job: "create"
}
secrets: config: {
type: "credential.acorn.io/postgres"
params: {
instructions: localData.instructions
promptOrder: ["proto", "address", "port", "adminUsername", "adminPassword", "dbName"]
}
data: {
address: ""
port: "5432"
adminUsername: ""
adminPassword: ""
proto: ""
dbName: ""
}
}
localData: instructions: """
## Overview
This will create the service from an existing Postgres server.
## Instructions
fill in:
- address: the address of the Postgres server endpoint (redis.example.com)
- port: the port of the Postgres server (5432)
- adminPassword: the main password to use to connect to the Postgres server as an admin
- proto: the protocol to use to connect to the Postgres server.
- dbName: the name of the database to use
"""
localData: info: """
## Usage
services: db: {
image: "ghcr.io/acorn-io/postgres:v#.#-#"
}
containers: app: {
image: "app-image"
env: {
DB_HOST: "@{@{service.}db.address}"
DB_PORT: "@{@{service.}db.port.5432}"
DB_NAME: "@{@{service.}db.data.dbName}"
DB_ADMIN_USER: "@{@{service.}db.secrets.admin.username}"
DB_ADMIN_PASS: "@{@{service.}db.secrets.admin.password}"
}
}
"""