From c2a17aeaec168a71b39aced2760e0a0b5cecdfb1 Mon Sep 17 00:00:00 2001 From: lukas Date: Wed, 2 Sep 2026 08:08:14 +0200 Subject: [PATCH] :sparkles: Update design --- .gitea/workflows/ci.yml | 12 ------------ Dockerfile | 13 +++++-------- docker-entrypoint.sh | 11 +++++++++++ 3 files changed, 16 insertions(+), 20 deletions(-) create mode 100644 docker-entrypoint.sh diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 6663636..38d4f8b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -78,17 +78,5 @@ jobs: echo "Deploying image:" echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}" - - # TrueNAS API deployment goes here. - # - # IMPORTANT: - # The exact JSON-RPC request depends on your TrueNAS SCALE - # version and the name of your Custom App. - # - # TRUENAS_URL should look like: - # https://truenas.example.com - # - # TRUENAS_API_KEY should be a TrueNAS API key with permission - # to update the application. echo "TrueNAS deployment configuration required." \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b93b09b..7e72747 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,6 @@ 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 @@ -21,11 +18,11 @@ 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 ./ +COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +RUN chmod +x /usr/local/bin/docker-entrypoint.sh + EXPOSE 3000 -CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "3000"] + +ENTRYPOINT ["docker-entrypoint.sh"] \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..07e0357 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +echo "==> Running database migrations..." +npx drizzle-kit migrate + +echo "==> Seeding database..." +npm run db:seed + +echo "==> Starting application..." +exec npm run preview -- --host 0.0.0.0 --port 3000 \ No newline at end of file