diff --git a/Dockerfile b/Dockerfile index a9c0349..c5df6b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ COPY package*.json ./ RUN npm ci --silent COPY . . RUN npm run build -EXPOSE 5173 -COPY docker-entrypoint.sh /usr/local/bin/ -ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["node", "dist/main.js"] + +FROM nginx:stable +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 5173 \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 4d9f742..3986b28 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,23 +1,8 @@ server { listen 5173; - resolver 8.8.8.8; location / { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html =404; } - location ~ ^/api/(.*)$ { - proxy_pass https://scanr-api.dataesr.ovh/$1$is_args$args; - proxy_set_header Authorization 'Basic $VITE_SCANR_API_AUTHORIZATION'; - proxy_set_header Accept application/json; - proxy_set_header Content-Type application/json; - client_max_body_size 10M; - } - location /email/ { - proxy_set_header accept application/json; - proxy_set_header api-key $VITE_BREVO_API_AUTHORIZATION; - proxy_set_header content-type application/json; - proxy_ssl_server_name on; - proxy_pass https://api.brevo.com/v3/smtp/email; - } } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 89c4e67..3cf7c09 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,7 @@ { "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], @@ -18,7 +20,8 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": ["src"], + "include": ["src/**/*"], + "exclude": ["node_modules"], "references": [ { "path": "./tsconfig.node.json" diff --git a/vite.config.ts b/vite.config.ts index 58676f7..5e5a662 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,14 @@ -import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; export default defineConfig({ plugins: [react()], + build: { + outDir: "dist", + rollupOptions: { + input: { + main: "./src/main.tsx", + }, + }, + }, });