Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# POSTGRES_USER=postgres
# POSTGRES_PASSWORD=password
# DATABASE_URL=postgresql://postgres:password@db:5432/postgres
# SENTRY_AUTH_TOKEN=
# PUBLIC_ENV=production # or staging

PUBLIC_ENV=dev

DATABASE_URL=postgresql://postgres@localhost:5432/postgres

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COPY package*.json ./
ENV DATABASE_HOST=localhost
RUN npm ci
COPY . .
ENV PUBLIC_ENV=production
RUN npm run build
RUN npm prune --production

Expand All @@ -17,6 +18,7 @@ COPY drizzle ./drizzle
COPY server.js .
ENV DATABASE_HOST=localhost
ENV BODY_SIZE_LIMIT=80M
ENV PUBLIC_ENV=production
EXPOSE 3000
ENV NODE_ENV=production
CMD ["sh","-c","mkdir -p /uploads/images && mkdir -p /uploads/models && npm run db:migrate && node server.js"]
9 changes: 8 additions & 1 deletion src/hooks.client.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit';
import * as Sentry from '@sentry/sveltekit';
import { PUBLIC_ENV } from '$env/static/public';

Sentry.init({
dsn: 'https://7caab434460a1585f4c87baa1a692427@o40609.ingest.us.sentry.io/4510461147742208',
dsn:
PUBLIC_ENV == 'staging' || PUBLIC_ENV == 'production'
? 'https://7caab434460a1585f4c87baa1a692427@o40609.ingest.us.sentry.io/4510461147742208'
: undefined,

tracesSampleRate: 1.0,

// Enable logs to be sent to Sentry
enableLogs: true,

// Environment
environment: PUBLIC_ENV,

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,
Expand Down
8 changes: 6 additions & 2 deletions src/instrumentation.server.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { PUBLIC_ENV } from '$env/static/public';
import * as Sentry from '@sentry/sveltekit';

Sentry.init({
dsn: 'https://7caab434460a1585f4c87baa1a692427@o40609.ingest.us.sentry.io/4510461147742208',
dsn:
PUBLIC_ENV == 'staging' || PUBLIC_ENV == 'production'
? 'https://7caab434460a1585f4c87baa1a692427@o40609.ingest.us.sentry.io/4510461147742208'
: undefined,

integrations: [Sentry.consoleLoggingIntegration({ levels: ['log', 'warn', 'error'] })],

tracesSampleRate: 1.0,

environment: process.env.SENTRY_ENVIRONMENT,
environment: PUBLIC_ENV,

// Enable logs to be sent to Sentry
enableLogs: true
Expand Down
Loading