chore: dev setup
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
"description": "Technical problem solver's blog - practical insights and learning notes",
|
"description": "Technical problem solver's blog - practical insights and learning notes",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm run seed:context && next dev --turbo",
|
"dev": "pnpm run seed:context && next dev --turbo",
|
||||||
|
"dev:native": "pnpm run seed:context && DATABASE_URI=postgres://directus:directus@127.0.0.1:54321/directus PAYLOAD_SECRET=dev-secret next dev --webpack",
|
||||||
"seed:context": "tsx ./seed-context.ts",
|
"seed:context": "tsx ./seed-context.ts",
|
||||||
"build": "next build --webpack",
|
"build": "next build --webpack",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import * as Sentry from "@sentry/nextjs";
|
import * as Sentry from "@sentry/nextjs";
|
||||||
|
|
||||||
const dsn = process.env.SENTRY_DSN;
|
const dsn = process.env.SENTRY_DSN;
|
||||||
|
const isProd = process.env.NODE_ENV === "production";
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn,
|
dsn,
|
||||||
enabled: Boolean(dsn),
|
enabled: isProd && Boolean(dsn),
|
||||||
tracesSampleRate: 1,
|
tracesSampleRate: 1,
|
||||||
debug: false,
|
debug: false,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import * as Sentry from "@sentry/nextjs";
|
import * as Sentry from "@sentry/nextjs";
|
||||||
|
|
||||||
const dsn = process.env.SENTRY_DSN;
|
const dsn = process.env.SENTRY_DSN;
|
||||||
|
const isProd = process.env.NODE_ENV === "production";
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn,
|
dsn,
|
||||||
enabled: Boolean(dsn),
|
enabled: isProd && Boolean(dsn),
|
||||||
|
|
||||||
tracesSampleRate: 1,
|
tracesSampleRate: 1,
|
||||||
debug: false,
|
debug: false,
|
||||||
|
|||||||
@@ -1,4 +1,16 @@
|
|||||||
services:
|
services:
|
||||||
|
# Lightweight proxy: gives Caddy the labels to route mintel.localhost → host Mac
|
||||||
|
proxy:
|
||||||
|
image: alpine:latest
|
||||||
|
command: sleep infinity
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- infra
|
||||||
|
labels:
|
||||||
|
- "caddy=http://${TRAEFIK_HOST:-mintel.localhost}"
|
||||||
|
- "caddy.reverse_proxy=host.docker.internal:3000"
|
||||||
|
|
||||||
|
# Full Docker dev (use with `pnpm run dev:docker`)
|
||||||
app:
|
app:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@@ -41,9 +53,10 @@ services:
|
|||||||
POSTGRES_DB: ${postgres_DB_NAME:-directus}
|
POSTGRES_DB: ${postgres_DB_NAME:-directus}
|
||||||
POSTGRES_USER: ${postgres_DB_USER:-directus}
|
POSTGRES_USER: ${postgres_DB_USER:-directus}
|
||||||
POSTGRES_PASSWORD: ${postgres_DB_PASSWORD:-directus}
|
POSTGRES_PASSWORD: ${postgres_DB_PASSWORD:-directus}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- directus-db-data:/var/lib/postgresql/data
|
- directus-db-data:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- "54321:5432"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "pnpm@10.18.3",
|
"packageManager": "pnpm@10.18.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "docker network create infra 2>/dev/null || true && echo \"\\n🚀 Dockerized Environment Starting...\\n\\n📱 App: http://mintel.localhost\\n🚦 Caddy Proxy: http://localhost:80\\n\" && COMPOSE_PROJECT_NAME=mintel-me docker-compose -f docker-compose.dev.yml up app postgres-db",
|
"dev": "COMPOSE_PROJECT_NAME=mintel-me docker-compose -f docker-compose.dev.yml up -d postgres-db proxy && NODE_ENV=development pnpm --filter @mintel/web dev:native",
|
||||||
|
"dev:docker": "docker network create infra 2>/dev/null || true && echo \"\\n🚀 Dockerized Environment Starting...\\n\\n📱 App: http://mintel.localhost\\n🚦 Caddy Proxy: http://localhost:80\\n\" && COMPOSE_PROJECT_NAME=mintel-me docker-compose -f docker-compose.dev.yml up app postgres-db",
|
||||||
"dev:clean": "pnpm dev:stop && rm -rf apps/web/.next apps/web/node_modules && pnpm install && pnpm dev",
|
"dev:clean": "pnpm dev:stop && rm -rf apps/web/.next apps/web/node_modules && pnpm install && pnpm dev",
|
||||||
"dev:stop": "COMPOSE_PROJECT_NAME=mintel-me docker-compose -f docker-compose.dev.yml down",
|
"dev:stop": "COMPOSE_PROJECT_NAME=mintel-me docker-compose -f docker-compose.dev.yml down",
|
||||||
"dev:local": "pnpm -r dev",
|
"dev:local": "pnpm -r dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user