Docker deployment setup

main
MiguelMLorente 2025-11-29 15:14:24 +01:00
parent f95cba9042
commit 26b228197e
3 changed files with 32 additions and 11 deletions

15
Dockerfile Normal file
View File

@ -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" ]

View File

@ -18,7 +18,6 @@
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"erasableSyntaxOnly": false,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true
}, },

View File

@ -2,20 +2,27 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
const serverRoutes = ["/access", "/buy/start", "/buy/complete", "/buy/cancel"]; 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/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
server: { server: {
proxy: Object.fromEntries( ...baseServerConfigBuilder("localhost"),
serverRoutes.map((key) => [ host: true
key,
{
target: "http://localhost:3000",
changeOrigin: true,
secure: false,
},
]),
),
}, },
preview: baseServerConfigBuilder("paysplit-app"),
plugins: [react()], plugins: [react()],
}); });