diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f973c69 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20-alpine AS builder +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +FROM nginx:alpine +COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/index.html b/index.html new file mode 100644 index 0000000..1d89e10 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +App
\ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..180a31b --- /dev/null +++ b/nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + location / { + try_files $uri $uri/ /index.html; + } + gzip on; + gzip_types text/plain text/css application/json application/javascript; +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..49356fa --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{"name":"pending-app","version":"1.0.0","type":"module","scripts":{"dev":"vite","build":"vite build"},"dependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"devDependencies":{"vite":"^5.0.0","@vitejs/plugin-react":"^4.0.0"}} \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..e9bc2ca --- /dev/null +++ b/src/App.jsx @@ -0,0 +1 @@ +import React from 'react';export default function App(){const n="{{ Nazwa }}",d="{{ Opis }}",s="{{ Styl }}",f="{{ Funkcje }}".split(", ");return(

{n}

{d}


Style: {s}

);} \ No newline at end of file diff --git a/src/main.jsx b/src/main.jsx new file mode 100644 index 0000000..6ce0c3a --- /dev/null +++ b/src/main.jsx @@ -0,0 +1 @@ +import React from 'react';import ReactDOM from 'react-dom/client';import App from './App.jsx';ReactDOM.createRoot(document.getElementById('root')).render(); \ No newline at end of file diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..c89cd00 --- /dev/null +++ b/vite.config.js @@ -0,0 +1 @@ +import {defineConfig} from 'vite';import react from '@vitejs/plugin-react';export default defineConfig({plugins:[react()]}); \ No newline at end of file