Skip to content

Commit a5b57a8

Browse files
committed
fix: Update .dockerignore to include additional test files and scripts; enhance Dockerfile comments for clarity and improve CSS flashing
1 parent d08a3a1 commit a5b57a8

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
node_modules
33
.pnp
44
.pnp.js
5+
bun.lockb
56

67
# Testing
78
coverage
89
*.log
10+
*.test.ts
11+
*.test.tsx
12+
*.spec.ts
13+
*.spec.tsx
14+
__tests__
15+
__mocks__
916

1017
# Production
1118
.output
@@ -45,8 +52,14 @@ yarn-error.log*
4552
README.md
4653
CHANGELOG.md
4754
LICENSE
55+
*.md
4856

4957
# Docker
5058
Dockerfile
5159
docker-compose.yml
5260
.dockerignore
61+
62+
# Scripts (unless needed)
63+
scripts
64+
docker-compose.yml
65+
.dockerignore

.github/workflows/docker-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
CACHEBUST=${{ github.sha }}
6262
cache-from: type=gha
6363
cache-to: type=gha,mode=max
64+
platforms: linux/arm64
6465

6566
- name: Trigger Coolify deployment
6667
run: |

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,38 @@
22
FROM oven/bun:1-alpine AS base
33
WORKDIR /app
44

5-
# Install dependencies
5+
# Install dependencies stage
66
FROM base AS deps
77
COPY package.json bun.lock* ./
88
RUN bun install --frozen-lockfile
99

10-
# Build the application
10+
# Build stage
1111
FROM base AS builder
1212
COPY --from=deps /app/node_modules ./node_modules
1313
COPY . .
1414
RUN bun run build
1515

16-
# Production image
16+
# Production stage - optimized
1717
FROM base AS runner
1818
WORKDIR /app
1919

20-
# Force cache bust
20+
# Force cache bust (keeps image fresh)
2121
ARG CACHEBUST=1
2222

23-
# Copy built application and ALL dependencies (not just production)
23+
# Copy built application and all dependencies
2424
COPY --from=builder /app/.output ./.output
2525
COPY --from=builder /app/package.json ./package.json
2626
COPY --from=builder /app/node_modules ./node_modules
2727

2828
# Set production environment
2929
ENV NODE_ENV=production
30-
31-
# Default port (can be overridden)
3230
ENV PORT=3000
3331

32+
# Don't run as root
33+
USER bun
34+
3435
# Expose the port
35-
EXPOSE ${PORT}
36+
EXPOSE 3000
3637

3738
# Start the application
3839
CMD ["bun", "run", ".output/server/index.mjs"]

src/routes/__root.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export const Route = createRootRouteWithContext<MyRouterContext>()({
3232
}),
3333
],
3434
links: [
35+
{
36+
rel: "preload",
37+
href: appCss,
38+
as: "style",
39+
},
3540
{
3641
rel: "stylesheet",
3742
href: appCss,

0 commit comments

Comments
 (0)