Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit ce5671b

Browse files
committed
add deployment
1 parent ee71030 commit ce5671b

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# flyctl launch added from .gitignore
2+
**/node_modules
3+
**/dump.rdb
4+
fly.toml

bin/spark-rewards.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const {
1313
'0xa0e36151B7074A4F2ec31b741C27E46FcbBE5379', // Patrick
1414
'0x646ac6F1941CAb0ce3fE1368e9AD30364a9F51dA', // Miroslav
1515
'0x3ee4A552b1a6519A266AEFb0514633F289FF2A9F' // Julian
16-
].join(',')
16+
].join(','),
17+
REDIS_URL: redisUrl = 'redis://localhost:6379'
1718
} = process.env
1819

1920
const logger = {
@@ -22,7 +23,14 @@ const logger = {
2223
request: ['1', 'true'].includes(requestLogging) ? console.info : () => {}
2324
}
2425

25-
const redis = new Redis()
26+
const redisUrlParsed = new URL(redisUrl)
27+
const redis = new Redis({
28+
host: redisUrlParsed.hostname,
29+
port: redisUrlParsed.port,
30+
username: redisUrlParsed.username,
31+
password: redisUrlParsed.password,
32+
family: 6 // required for upstash
33+
})
2634

2735
const handler = await createHandler({ logger, redis, signerAddresses })
2836
const server = http.createServer(handler)

fly.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# fly.toml app configuration file generated for spark-rewards on 2024-08-29T08:00:20+02:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'spark-rewards'
7+
primary_region = 'cdg'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 8000
13+
force_https = true
14+
auto_stop_machines = 'off'
15+
processes = ['app']
16+
17+
[[vm]]
18+
size = 'shared-cpu-1x'

0 commit comments

Comments
 (0)