✨ first version
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
# Dummy values so the build-time env checks in src/db/index.ts and
|
||||
# src/lib/auth-instance.ts don't throw while bundling. The real values are
|
||||
# supplied at container runtime.
|
||||
ENV DATABASE_URL=postgres://build:build@localhost:5432/build \
|
||||
BETTER_AUTH_SECRET=build-time-placeholder \
|
||||
BETTER_AUTH_URL=http://localhost:3000
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# This build has no standalone Node server entrypoint — dist/server/server.js
|
||||
# only exports a fetch handler. `vite preview` (via the tanstackStart plugin)
|
||||
# is the supported way to serve it, and it re-resolves the app's router entry
|
||||
# from src/ at startup, so the full source tree (not just dist/) has to ship.
|
||||
COPY --from=builder /app ./
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "3000"]
|
||||
Reference in New Issue
Block a user