This commit is contained in:
End 2025-12-17 04:42:07 -07:00
parent 1f83228190
commit 76e4790142
No known key found for this signature in database
6 changed files with 41 additions and 3 deletions

6
.dockerignore Normal file
View file

@ -0,0 +1,6 @@
# flyctl launch added from .gitignore
# deps
**/node_modules
**/.env
**/my.db
fly.toml

13
Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM oven/bun:1
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY . .
RUN mkdir -p /data
EXPOSE 3000
CMD ["bun", "run", "src/index.ts"]

View file

@ -5,7 +5,6 @@
"": {
"name": "haxmas-day-4",
"dependencies": {
"better-sqlite3": "^12.5.0",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.45.1",
"hono": "^4.11.1",

20
fly.toml Normal file
View file

@ -0,0 +1,20 @@
# fly.toml app configuration file generated for wishlist-api-hc on 2025-12-17T04:37:10-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'wishlist-api-hc'
primary_region = 'lax'
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
memory = '1gb'
cpus = 1
memory_mb = 1024

View file

@ -4,7 +4,6 @@
"dev": "bun run --hot src/index.ts"
},
"dependencies": {
"better-sqlite3": "^12.5.0",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.45.1",
"hono": "^4.11.1"

View file

@ -1,4 +1,5 @@
import "dotenv/config";
import { drizzle } from "drizzle-orm/bun-sqlite";
import { Database } from "bun:sqlite";
export const db = drizzle(process.env.DB_FILE_NAME!);
export const db = drizzle(new Database(process.env.DB_FILE_NAME!));