created dockerfile for deployment with dokploy.
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.dockerignore
|
||||||
|
Dockerfile
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
.pnpm-store
|
||||||
|
.npm
|
||||||
|
.yarn
|
||||||
|
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
.convex/local
|
||||||
|
.svelte-kit
|
||||||
|
build
|
||||||
|
dist
|
||||||
|
coverage
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
- Switched the SvelteKit app to `@sveltejs/adapter-node` for production Node hosting.
|
- Switched the SvelteKit app to `@sveltejs/adapter-node` for production Node hosting.
|
||||||
- Added pnpm production scripts, a production environment example, and source-control ignores for local/build artifacts.
|
- Added pnpm production scripts, a production environment example, and source-control ignores for local/build artifacts.
|
||||||
- Documented production build/start commands and Convex Auth production environment requirements.
|
- Documented production build/start commands and Convex Auth production environment requirements.
|
||||||
|
- Added a root Dockerfile and `.dockerignore` for Dokploy Dockerfile deployments.
|
||||||
|
|
||||||
## 0.1.0 - 2026-06-04
|
## 0.1.0 - 2026-06-04
|
||||||
|
|
||||||
|
|||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
FROM node:24-alpine AS base
|
||||||
|
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN corepack enable && corepack prepare pnpm@10.33.4 --activate
|
||||||
|
|
||||||
|
FROM base AS deps
|
||||||
|
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
FROM deps AS build
|
||||||
|
|
||||||
|
ARG PUBLIC_CONVEX_URL=https://stoic-spaniel-277.eu-west-1.convex.cloud
|
||||||
|
ARG PUBLIC_CONVEX_SITE_URL=https://stoic-spaniel-277.eu-west-1.convex.site
|
||||||
|
|
||||||
|
ENV PUBLIC_CONVEX_URL=$PUBLIC_CONVEX_URL
|
||||||
|
ENV PUBLIC_CONVEX_SITE_URL=$PUBLIC_CONVEX_SITE_URL
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN pnpm build
|
||||||
|
RUN pnpm prune --prod
|
||||||
|
|
||||||
|
FROM node:24-alpine AS runner
|
||||||
|
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
ENV PUBLIC_CONVEX_URL=https://stoic-spaniel-277.eu-west-1.convex.cloud
|
||||||
|
ENV PUBLIC_CONVEX_SITE_URL=https://stoic-spaniel-277.eu-west-1.convex.site
|
||||||
|
ENV HOST=0.0.0.0
|
||||||
|
ENV PORT=3000
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=build /app/build ./build
|
||||||
|
COPY --from=build /app/node_modules ./node_modules
|
||||||
|
COPY --from=build /app/package.json ./package.json
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["node", "build"]
|
||||||
@@ -70,6 +70,32 @@ For a single local smoke test that builds and starts the production server:
|
|||||||
pnpm prod
|
pnpm prod
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Docker Deployment
|
||||||
|
|
||||||
|
The root `Dockerfile` builds the SvelteKit Node server with pnpm and runs it with `node build`.
|
||||||
|
|
||||||
|
Build locally:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker build \
|
||||||
|
--build-arg PUBLIC_CONVEX_URL=https://your-production-deployment.convex.cloud \
|
||||||
|
--build-arg PUBLIC_CONVEX_SITE_URL=https://your-production-deployment.convex.site \
|
||||||
|
-t journaley .
|
||||||
|
```
|
||||||
|
|
||||||
|
Run locally:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run --rm -p 3000:3000 \
|
||||||
|
-e PUBLIC_CONVEX_URL=https://your-production-deployment.convex.cloud \
|
||||||
|
-e PUBLIC_CONVEX_SITE_URL=https://your-production-deployment.convex.site \
|
||||||
|
-e HOST=0.0.0.0 \
|
||||||
|
-e PORT=3000 \
|
||||||
|
journaley
|
||||||
|
```
|
||||||
|
|
||||||
|
For Dokploy, choose a Dockerfile deployment, keep the Dockerfile path as `Dockerfile`, expose container port `3000`, and set the same environment variables in the Dokploy app settings. The public Convex URLs are also defined as Docker build args because SvelteKit's public static env values are compiled into the app during the image build.
|
||||||
|
|
||||||
## Auth
|
## Auth
|
||||||
|
|
||||||
This project uses Convex Auth with email/password for local development. The initializer created `convex/auth.config.ts`, `convex/auth.ts`, and `convex/http.ts`; the frontend uses `@mmailaender/convex-auth-svelte` for SvelteKit auth state and auth routes.
|
This project uses Convex Auth with email/password for local development. The initializer created `convex/auth.config.ts`, `convex/auth.ts`, and `convex/http.ts`; the frontend uses `@mmailaender/convex-auth-svelte` for SvelteKit auth state and auth routes.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"name": "journaley",
|
"name": "journaley",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"packageManager": "pnpm@10.33.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
|||||||
Reference in New Issue
Block a user