|
| 1 | +# yaml-language-server: $schema=https://schema.zeabur.app/template.json |
| 2 | +apiVersion: zeabur.com/v1 |
| 3 | +kind: Template |
| 4 | +metadata: |
| 5 | + name: database-playground-main |
| 6 | +spec: |
| 7 | + description: The main applications of Database Playground |
| 8 | + icon: https://s3.dbplay.pan93.com/icon.svg |
| 9 | + services: |
| 10 | + - name: postgresql |
| 11 | + icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/postgresql.svg |
| 12 | + template: PREBUILT_V2 |
| 13 | + spec: |
| 14 | + source: |
| 15 | + image: docker.io/pgautoupgrade/pgautoupgrade:17-alpine |
| 16 | + command: |
| 17 | + - docker-entrypoint.sh |
| 18 | + - -c |
| 19 | + - config_file=/etc/postgresql/postgresql.conf |
| 20 | + ports: |
| 21 | + - id: database |
| 22 | + port: 5432 |
| 23 | + type: TCP |
| 24 | + volumes: |
| 25 | + - id: data |
| 26 | + dir: /var/lib/postgresql/data |
| 27 | + instructions: |
| 28 | + - type: TEXT |
| 29 | + title: Connection String |
| 30 | + content: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE} |
| 31 | + - type: TEXT |
| 32 | + title: PostgreSQL Connect Command |
| 33 | + content: psql "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}" |
| 34 | + - type: TEXT |
| 35 | + title: PostgreSQL username |
| 36 | + content: ${POSTGRES_USERNAME} |
| 37 | + category: Credentials |
| 38 | + - type: PASSWORD |
| 39 | + title: PostgresSQL password |
| 40 | + content: ${POSTGRES_PASSWORD} |
| 41 | + category: Credentials |
| 42 | + - type: TEXT |
| 43 | + title: PostgresSQL database |
| 44 | + content: ${POSTGRES_DATABASE} |
| 45 | + category: Credentials |
| 46 | + - type: TEXT |
| 47 | + title: PostgreSQL host |
| 48 | + content: ${PORT_FORWARDED_HOSTNAME} |
| 49 | + category: Hostname & Port |
| 50 | + - type: TEXT |
| 51 | + title: PostgreSQL port |
| 52 | + content: ${DATABASE_PORT_FORWARDED_PORT} |
| 53 | + category: Hostname & Port |
| 54 | + env: |
| 55 | + PGDATA: |
| 56 | + default: /var/lib/postgresql/data/pgdata |
| 57 | + expose: false |
| 58 | + POSTGRES_CONNECTION_STRING: |
| 59 | + default: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE} |
| 60 | + expose: true |
| 61 | + POSTGRES_DATABASE: |
| 62 | + default: ${POSTGRES_DB} |
| 63 | + expose: true |
| 64 | + POSTGRES_DB: |
| 65 | + default: zeabur |
| 66 | + expose: false |
| 67 | + POSTGRES_HOST: |
| 68 | + default: ${CONTAINER_HOSTNAME} |
| 69 | + expose: true |
| 70 | + POSTGRES_PASSWORD: |
| 71 | + default: ${PASSWORD} |
| 72 | + expose: true |
| 73 | + POSTGRES_PORT: |
| 74 | + default: ${DATABASE_PORT} |
| 75 | + expose: true |
| 76 | + POSTGRES_URI: |
| 77 | + default: ${POSTGRES_CONNECTION_STRING} |
| 78 | + expose: true |
| 79 | + POSTGRES_USER: |
| 80 | + default: root |
| 81 | + expose: false |
| 82 | + POSTGRES_USERNAME: |
| 83 | + default: ${POSTGRES_USER} |
| 84 | + expose: true |
| 85 | + configs: |
| 86 | + - path: /etc/postgresql/postgresql.conf |
| 87 | + template: | |
| 88 | + # https://github.com/postgres/postgres/blob/master/src/backend/utils/misc/postgresql.conf.sample |
| 89 | + listen_addresses = '*' |
| 90 | + max_connections = 100 |
| 91 | + shared_buffers = 128MB |
| 92 | + dynamic_shared_memory_type = posix |
| 93 | + max_wal_size = 1GB |
| 94 | + min_wal_size = 80MB |
| 95 | + log_timezone = 'Etc/UTC' |
| 96 | + datestyle = 'iso, mdy' |
| 97 | + timezone = 'Etc/UTC' |
| 98 | + lc_messages = 'en_US.utf8' |
| 99 | + lc_monetary = 'en_US.utf8' |
| 100 | + lc_numeric = 'en_US.utf8' |
| 101 | + lc_time = 'en_US.utf8' |
| 102 | + default_text_search_config = 'pg_catalog.english' |
| 103 | + permission: null |
| 104 | + envsubst: null |
| 105 | + - name: redis |
| 106 | + icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/redis.svg |
| 107 | + template: PREBUILT_V2 |
| 108 | + spec: |
| 109 | + source: |
| 110 | + image: redis/redis-stack-server:latest |
| 111 | + ports: |
| 112 | + - id: database |
| 113 | + port: 6379 |
| 114 | + type: TCP |
| 115 | + volumes: |
| 116 | + - id: data |
| 117 | + dir: /data |
| 118 | + instructions: |
| 119 | + - type: TEXT |
| 120 | + title: Command to connect to your Redis |
| 121 | + content: redis-cli -h ${PORT_FORWARDED_HOSTNAME} -p ${DATABASE_PORT_FORWARDED_PORT} -a ${REDIS_PASSWORD} |
| 122 | + - type: TEXT |
| 123 | + title: Redis Connection String |
| 124 | + content: redis://:${REDIS_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT} |
| 125 | + - type: PASSWORD |
| 126 | + title: Redis password |
| 127 | + content: ${REDIS_PASSWORD} |
| 128 | + category: Credentials |
| 129 | + - type: TEXT |
| 130 | + title: Redis host |
| 131 | + content: ${PORT_FORWARDED_HOSTNAME} |
| 132 | + category: Hostname & Port |
| 133 | + - type: TEXT |
| 134 | + title: Redis port |
| 135 | + content: ${DATABASE_PORT_FORWARDED_PORT} |
| 136 | + category: Hostname & Port |
| 137 | + env: |
| 138 | + CONFFILE: |
| 139 | + default: /etc/redis-stack.conf |
| 140 | + expose: false |
| 141 | + REDIS_ARGS: |
| 142 | + default: --requirepass ${REDIS_PASSWORD} |
| 143 | + expose: false |
| 144 | + REDIS_CONNECTION_STRING: |
| 145 | + default: redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT} |
| 146 | + expose: true |
| 147 | + REDIS_HOST: |
| 148 | + default: ${CONTAINER_HOSTNAME} |
| 149 | + expose: true |
| 150 | + REDIS_PASSWORD: |
| 151 | + default: ${PASSWORD} |
| 152 | + expose: true |
| 153 | + REDIS_PORT: |
| 154 | + default: ${DATABASE_PORT} |
| 155 | + expose: true |
| 156 | + REDIS_URI: |
| 157 | + default: ${REDIS_CONNECTION_STRING} |
| 158 | + expose: true |
| 159 | + configs: |
| 160 | + - path: /etc/redis-stack.conf |
| 161 | + template: | |
| 162 | + port 6379 |
| 163 | + daemonize no |
| 164 | + permission: null |
| 165 | + envsubst: null |
| 166 | + - name: meilisearch |
| 167 | + icon: https://www.meilisearch.com/favicon.svg |
| 168 | + template: PREBUILT_V2 |
| 169 | + spec: |
| 170 | + source: |
| 171 | + image: getmeili/meilisearch |
| 172 | + ports: |
| 173 | + - id: web |
| 174 | + port: 7700 |
| 175 | + type: HTTP |
| 176 | + volumes: |
| 177 | + - id: data |
| 178 | + dir: /meili_data |
| 179 | + instructions: |
| 180 | + - type: PASSWORD |
| 181 | + title: Meilisearch Master Key |
| 182 | + content: ${MEILI_MASTER_KEY} |
| 183 | + category: Credentials |
| 184 | + env: |
| 185 | + MEILI_MASTER_KEY: |
| 186 | + default: ${PASSWORD} |
| 187 | + expose: true |
| 188 | + configs: [] |
| 189 | + - name: sqlrunner |
| 190 | + icon: https://upload.wikimedia.org/wikipedia/commons/9/97/Sqlite-square-icon.svg |
| 191 | + template: PREBUILT_V2 |
| 192 | + spec: |
| 193 | + source: |
| 194 | + image: ghcr.io/database-playground/sqlrunner-v2:main |
| 195 | + ports: |
| 196 | + - id: web |
| 197 | + port: 8080 |
| 198 | + type: HTTP |
| 199 | + configs: [] |
| 200 | + - name: app |
| 201 | + icon: https://s3.dbplay.pan93.com/icon.svg |
| 202 | + template: PREBUILT_V2 |
| 203 | + spec: |
| 204 | + source: |
| 205 | + image: ghcr.io/database-playground/app-sf:master |
| 206 | + ports: |
| 207 | + - id: web |
| 208 | + port: 3000 |
| 209 | + type: HTTP |
| 210 | + env: |
| 211 | + APP_SECRET: |
| 212 | + default: ${PASSWORD} |
| 213 | + DATABASE_URL: |
| 214 | + default: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@postgresql.zeabur.internal:5432/${POSTGRES_DATABASE}?serverVersion=17&charset=utf8 |
| 215 | + expose: true |
| 216 | + LINE_NOTIFY_DSN: |
| 217 | + default: linenotify://<TOKEN>@default |
| 218 | + expose: true |
| 219 | + MEILISEARCH_API_KEY: |
| 220 | + default: ${MEILI_MASTER_KEY} |
| 221 | + expose: true |
| 222 | + MEILISEARCH_URL: |
| 223 | + default: http://meilisearch.zeabur.internal:7700 |
| 224 | + expose: true |
| 225 | + OPENAI_API_KEY: |
| 226 | + default: <YOUR_OPENAI_KEY> |
| 227 | + expose: true |
| 228 | + REDIS_URI: |
| 229 | + default: ${REDIS_CONNECTION_STRING} |
| 230 | + expose: true |
| 231 | + SERVER_NAME: |
| 232 | + default: :3000 |
| 233 | + expose: false |
| 234 | + SQLRUNNER_URL: |
| 235 | + default: http://sqlrunner.zeabur.internal:8080 |
| 236 | + expose: true |
| 237 | + UMAMI_DOMAIN: |
| 238 | + default: <YOUR_UMAMI_DOMAIN> |
| 239 | + expose: false |
| 240 | + UMAMI_WEBSITE_ID: |
| 241 | + default: <YOUR_UMAMI_WEBSITE_ID> |
| 242 | + expose: false |
| 243 | + MESSENGER_TRANSPORT_DSN: |
| 244 | + default: ${REDIS_URI}/messages |
| 245 | + expose: true |
| 246 | + configs: [] |
| 247 | + - name: worker-1 |
| 248 | + icon: https://s3.dbplay.pan93.com/icon.svg |
| 249 | + template: PREBUILT_V2 |
| 250 | + spec: |
| 251 | + source: |
| 252 | + image: ghcr.io/database-playground/app-sf-worker:master |
| 253 | + env: |
| 254 | + MESSENGER_CONSUMER_NAME: |
| 255 | + default: app-sf-worker-1 |
| 256 | + expose: false |
| 257 | + configs: [] |
| 258 | + - name: worker-2 |
| 259 | + icon: https://s3.dbplay.pan93.com/icon.svg |
| 260 | + template: PREBUILT_V2 |
| 261 | + spec: |
| 262 | + source: |
| 263 | + image: ghcr.io/database-playground/app-sf-worker:master |
| 264 | + env: |
| 265 | + MESSENGER_CONSUMER_NAME: |
| 266 | + default: app-sf-worker-2 |
| 267 | + expose: false |
| 268 | + configs: [] |
| 269 | + - name: worker-3 |
| 270 | + icon: https://s3.dbplay.pan93.com/icon.svg |
| 271 | + template: PREBUILT_V2 |
| 272 | + spec: |
| 273 | + source: |
| 274 | + image: ghcr.io/database-playground/app-sf-worker:master |
| 275 | + env: |
| 276 | + MESSENGER_CONSUMER_NAME: |
| 277 | + default: app-sf-worker-3 |
| 278 | + expose: false |
| 279 | + configs: [] |
0 commit comments