diff --git a/src/Dockerfile b/src/Dockerfile index ce4bbe978..8d395f9c8 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -233,4 +233,4 @@ RUN apk update && apk upgrade --no-cache COPY --from=collect /srv/app/ ./ CMD [".output/server/index.mjs"] -HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost:3000/api/healthcheck || exit 1 +HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost:3001/api/healthcheck || exit 1 diff --git a/src/Dockerfile.arm64-v8 b/src/Dockerfile.arm64-v8 index 9ddeaefa5..1e05ca7c5 100644 --- a/src/Dockerfile.arm64-v8 +++ b/src/Dockerfile.arm64-v8 @@ -242,4 +242,4 @@ RUN apk update && apk upgrade --no-cache COPY --from=collect /srv/app/ ./ CMD [".output/server/index.mjs"] -HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost:3000/api/healthcheck || exit 1 +HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost:3001/api/healthcheck || exit 1 diff --git a/src/nuxt.config.ts b/src/nuxt.config.ts index 1d272c8e3..f82f34aa7 100644 --- a/src/nuxt.config.ts +++ b/src/nuxt.config.ts @@ -14,7 +14,9 @@ for (const exclusion of SITEMAP_EXCLUSIONS) { const BASE_URL = 'https://' + (process.env.NUXT_PUBLIC_STACK_DOMAIN || - `${process.env.HOST || 'localhost'}:3000`) + `${process.env.HOST || 'localhost'}:${ + process.env.NODE_ENV === 'development' ? '3000' : '3001' + }`) export default defineNuxtConfig({ app: { diff --git a/src/package.json b/src/package.json index eaf7b3b21..d928b4aef 100644 --- a/src/package.json +++ b/src/package.json @@ -11,7 +11,7 @@ "scripts": { "dev": "nuxt dev", "build": "nuxt build", - "start": "node .output/server/index.mjs", + "start": "PORT=3001 node .output/server/index.mjs", "test": "vitest", "test:e2e": "./tests/e2e/screenshots/test.sh", "test:e2e:dev": "cross-env NUXT_PUBLIC_IS_TESTING=1 WAIT_ON_TIMEOUT=100000 pnpm test:e2e", diff --git a/src/playwright.config.ts b/src/playwright.config.ts index aff03b2fc..05400f2bd 100644 --- a/src/playwright.config.ts +++ b/src/playwright.config.ts @@ -6,6 +6,11 @@ import { defineConfig, devices } from '@playwright/test' */ // require('dotenv').config(); +const baseUrl = + process.env.NODE_ENV === 'development' + ? 'http://127.0.0.1:3000' + : 'http://127.0.0.1:3001' + /** * See https://playwright.dev/docs/test-configuration. */ @@ -74,7 +79,7 @@ export default defineConfig({ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: 'http://127.0.0.1:3000', + baseURL: baseUrl, /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', @@ -85,11 +90,8 @@ export default defineConfig({ command: process.env.NODE_ENV === 'development' ? 'pnpm run dev' - : 'PORT=3001 pnpm run start', - url: - process.env.NODE_ENV === 'development' - ? 'http://127.0.0.1:3000' - : 'http://127.0.0.1:3001', + : 'pnpm run start', + url: baseUrl, reuseExistingServer: !process.env.CI, }, diff --git a/todo/server.cy.ts b/todo/server.cy.ts index 1e60f3450..1aefacbcc 100644 --- a/todo/server.cy.ts +++ b/todo/server.cy.ts @@ -50,7 +50,7 @@ describe('headers middleware', () => { }).then((resp) => { expect(resp.headers['content-security-policy']).to.equal( Cypress.env('NODE_ENV') === 'production' - ? "connect-src 'self' blob: https://localhost:3000 https://postgraphile.localhost:3000 https://tusd.localhost:3000 https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://localhost:3000/cdn-cgi/rum;base-uri 'none';default-src 'none';font-src 'self';form-action 'self';frame-ancestors 'none';frame-src https://challenges.cloudflare.com;img-src 'self' blob: data: https://tusd.localhost:3000 https://*.google-analytics.com https://*.googletagmanager.com https://www.gravatar.com/avatar/;manifest-src 'self';media-src 'none';object-src 'none';prefetch-src 'self';report-uri https://dargmuesli.report-uri.com/r/d/csp/enforce;script-src blob: 'self' https://challenges.cloudflare.com https://static.cloudflareinsights.com https://*.googletagmanager.com 'unsafe-inline' 'unsafe-eval';style-src 'self' 'unsafe-inline';" + ? "connect-src 'self' blob: https://localhost:3001 https://postgraphile.localhost:3001 https://tusd.localhost:3001 https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://localhost:3001/cdn-cgi/rum;base-uri 'none';default-src 'none';font-src 'self';form-action 'self';frame-ancestors 'none';frame-src https://challenges.cloudflare.com;img-src 'self' blob: data: https://tusd.localhost:3001 https://*.google-analytics.com https://*.googletagmanager.com https://www.gravatar.com/avatar/;manifest-src 'self';media-src 'none';object-src 'none';prefetch-src 'self';report-uri https://dargmuesli.report-uri.com/r/d/csp/enforce;script-src blob: 'self' https://challenges.cloudflare.com https://static.cloudflareinsights.com https://*.googletagmanager.com 'unsafe-inline' 'unsafe-eval';style-src 'self' 'unsafe-inline';" : "connect-src 'self' blob: https://maev.si https://postgraphile.maev.si https://tusd.maev.si https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com http://localhost:24678/_nuxt/ https://localhost:24678/_nuxt/ ws://localhost:24678/_nuxt/ wss://localhost:24678/_nuxt/;base-uri 'none';default-src 'none';font-src 'self';form-action 'self';frame-ancestors 'none';frame-src https://challenges.cloudflare.com;img-src 'self' blob: data: https://tusd.maev.si https://*.google-analytics.com https://*.googletagmanager.com https://www.gravatar.com/avatar/;manifest-src 'self';media-src 'none';object-src 'none';prefetch-src 'self';report-uri https://dargmuesli.report-uri.com/r/d/csp/enforce;script-src blob: 'self' https://challenges.cloudflare.com https://static.cloudflareinsights.com https://*.googletagmanager.com 'unsafe-inline' 'unsafe-eval';style-src 'self' 'unsafe-inline';" ) })