diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9cf36a4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ + +FROM node:20 + +WORKDIR /app + +COPY package.json . +RUN npm install + +COPY . . + +RUN npm run build + +EXPOSE 8000 + +CMD [ "npm", "run", "preview" ] \ No newline at end of file diff --git a/tsconfig.node.json b/tsconfig.node.json index 3439137..b7c768c 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -18,7 +18,6 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "erasableSyntaxOnly": false, "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true }, diff --git a/vite.config.ts b/vite.config.ts index cefd6c6..8bcff89 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,20 +2,27 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; const serverRoutes = ["/access", "/buy/start", "/buy/complete", "/buy/cancel"]; +const baseServerConfigBuilder = (domain: string) => ({ + proxy: Object.fromEntries( + serverRoutes.map((key) => [ + key, + { + target: `http://${domain}:3000`, + changeOrigin: true, + secure: false, + }, + ]), + ), + port: 8000, + strictPort: true, +}); // https://vite.dev/config/ export default defineConfig({ server: { - proxy: Object.fromEntries( - serverRoutes.map((key) => [ - key, - { - target: "http://localhost:3000", - changeOrigin: true, - secure: false, - }, - ]), - ), + ...baseServerConfigBuilder("localhost"), + host: true }, + preview: baseServerConfigBuilder("paysplit-app"), plugins: [react()], });