From 1b1c0a9d7ae41bc7380f1b180f59c0f8ae2d5752 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Tue, 8 Oct 2024 02:07:03 +0700 Subject: [PATCH] fix: docker deployment --- .dockerignore | 2 ++ Dockerfile | 4 ++-- README.md | 10 ++++++++++ fly.toml | 10 +--------- package.json | 1 - src/main.ts | 9 +++++---- yarn.lock | 4 ---- 7 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 package.json delete mode 100644 yarn.lock diff --git a/.dockerignore b/.dockerignore index 0501d09..d677649 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,3 @@ fly.toml +node_modules + diff --git a/Dockerfile b/Dockerfile index f7ed053..f3d52bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ EXPOSE 8080 WORKDIR /app -USER deno - COPY . . +USER deno + CMD ["task", "start"] diff --git a/README.md b/README.md index 132ea38..a5994ae 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ A minimal LNURL + Zapper service powered powered by [NWC](https://nwc.dev) ## Deployment +### Docker (from Alby's Container Registry) + +`docker run -p 8080:8080 --pull always ghcr.io/getalby/lite:latest` + +### Docker (from source) + +docker run -p 8080:8080 $(docker build -q .) + +### Deploy on Fly + - `fly deploy` ## TODOs diff --git a/fly.toml b/fly.toml index 9c55f0c..348830f 100644 --- a/fly.toml +++ b/fly.toml @@ -30,12 +30,4 @@ primary_region = 'lax' [[vm]] memory = '1gb' cpu_kind = 'shared' - cpus = 1 - -[[mounts]] - source = 'app' - destination = '/app' - initial_size = '1' - auto_extend_size_threshold = 80 - auto_extend_size_increment = "1GB" - auto_extend_size_limit = "5GB" \ No newline at end of file + cpus = 1 \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 0967ef4..0000000 --- a/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/main.ts b/src/main.ts index 2c3df80..295b4a2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { Hono } from "hono"; import { serveStatic } from "hono/deno"; import { secureHeaders } from "hono/secure-headers"; -import { sentry } from "npm:@hono/sentry"; +//import { sentry } from "npm:@hono/sentry"; import { PORT } from "./constants.ts"; import { DB, runMigration } from "./db/db.ts"; import { createLnurlApp } from "./lnurlp.ts"; @@ -15,15 +15,16 @@ const db = new DB(); const nwcPool = new NWCPool(db); await nwcPool.init(); -const SENTRY_DSN = Deno.env.get("SENTRY_DSN"); +// TODO: re-enable sentry +//const SENTRY_DSN = Deno.env.get("SENTRY_DSN"); const hono = new Hono(); hono.use(loggerMiddleware()); hono.use(secureHeaders()); -if (SENTRY_DSN) { +/*if (SENTRY_DSN) { hono.use("*", sentry({ dsn: SENTRY_DSN })); -} +}*/ hono.route("/.well-known/lnurlp", createLnurlApp(db)); hono.route("/users", createUsersApp(db, nwcPool)); diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index fb57ccd..0000000 --- a/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - -