Skip to content

Commit f8d82ce

Browse files
committed
Merge branch 'dev'
2 parents 1f0d404 + 49efe41 commit f8d82ce

File tree

5 files changed

+120
-0
lines changed

5 files changed

+120
-0
lines changed

.dockerignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
node_modules
2+
.git
3+
.github
4+
.vscode
5+
.claude
6+
.explore
7+
.env
8+
.env.local
9+
dist
10+
temp
11+
docs
12+
plan
13+
studio
14+
assets
15+
16+
# Ignore local dependency lock files if they conflict with bun.lock
17+
pnpm-lock.yaml
18+
package-lock.json
19+
yarn.lock
20+
21+
# App/Package specific ignores
22+
apps/*/node_modules
23+
apps/*/dist
24+
packages/*/node_modules
25+
packages/*/dist
26+
27+
# Logs and system files
28+
*.log
29+
.DS_Store

.github/workflows/deploy-hono.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy to Fly.io
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'apps/hono-example/**'
9+
- 'packages/**'
10+
- 'package.json'
11+
- 'bun.lock'
12+
- '.github/workflows/deploy-hono.yml'
13+
14+
jobs:
15+
deploy:
16+
name: Deploy App
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup flyctl
23+
uses: superfly/flyctl-actions/setup-flyctl@master
24+
25+
- name: Deploy to Fly.io
26+
run: flyctl deploy --remote-only --config apps/hono-example/fly.toml --dockerfile apps/hono-example/Dockerfile
27+
env:
28+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

apps/hono-example/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM oven/bun:1.1 as base
2+
WORKDIR /app
3+
4+
# Install dependencies into temp directory
5+
# This will cache them and speed up future builds
6+
FROM base AS install
7+
RUN mkdir -p /temp/dev
8+
COPY package.json bun.lock /temp/dev/
9+
COPY apps/hono-example/package.json /temp/dev/apps/hono-example/
10+
COPY packages/engine/package.json /temp/dev/packages/engine/
11+
COPY packages/adapter-hono/package.json /temp/dev/packages/adapter-hono/
12+
COPY packages/plugin-cache/package.json /temp/dev/packages/plugin-cache/
13+
14+
RUN cd /temp/dev && bun install --frozen-lockfile
15+
16+
# Copy node_modules from temp directory
17+
# Then copy all source files and build
18+
FROM base AS prerelease
19+
COPY --from=install /temp/dev/node_modules node_modules
20+
COPY . .
21+
22+
# [Optional] Tests & build
23+
ENV NODE_ENV=production
24+
# RUN bun test --cwd apps/hono-example
25+
26+
# Final image
27+
FROM base AS release
28+
COPY --from=install /temp/dev/node_modules node_modules
29+
COPY --from=prerelease /app/apps/hono-example apps/hono-example
30+
COPY --from=prerelease /app/packages packages
31+
COPY --from=prerelease /app/package.json .
32+
33+
# Create a simple entrypoint script to handle migrations or seeding if needed
34+
USER bun
35+
EXPOSE 5000/tcp
36+
ENTRYPOINT [ "bun", "run", "--cwd", "apps/hono-example", "src/index.ts" ]

apps/hono-example/fly.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
app = "tablecraft-hono-example"
2+
primary_region = "ams"
3+
4+
[build]
5+
dockerfile = "Dockerfile"
6+
7+
[http_service]
8+
internal_port = 5000
9+
force_https = true
10+
auto_stop_machines = true
11+
auto_start_machines = true
12+
min_machines_running = 0
13+
processes = ["app"]
14+
15+
[[vm]]
16+
memory = "512mb"
17+
cpu_kind = "shared"
18+
cpus = 1
19+
20+
[env]
21+
PORT = "5000"
22+
NODE_ENV = "production"
23+
24+
[deploy]
25+
# Optional: run migrations before starting the app
26+
# release_command = "bun run --cwd apps/hono-example db:push"

temp/awesome-shadcn-ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit ad5eb2623dac283e203fdb1ee3a93fd10139c720

0 commit comments

Comments
 (0)