From 4140a77ce33e98994c64c88b3ead3d7602b12421 Mon Sep 17 00:00:00 2001 From: dorian melenotte Date: Wed, 31 Jul 2024 20:14:18 +0200 Subject: [PATCH] add: script start and dokerfile --- dokerfile | 12 ++++++++++++ nginx.conf | 18 ++++++++++++++++++ package.json | 1 + src/component/Button.jsx | 3 +++ src/component/Card.jsx | 20 ++++++++++++++++++++ src/main.jsx | 15 +++++++++++++++ 6 files changed, 69 insertions(+) create mode 100644 dokerfile create mode 100644 nginx.conf create mode 100644 src/component/Button.jsx create mode 100644 src/component/Card.jsx diff --git a/dokerfile b/dokerfile new file mode 100644 index 0000000..d9d23d4 --- /dev/null +++ b/dokerfile @@ -0,0 +1,12 @@ +FROM thecodingmachine/nodejs:16-bun AS build +WORKDIR /app +COPY package.json bun.lockb . +RUN bun install +COPY . . +RUN bun run build + +FROM nginx:stable-alpine AS production +COPY --from=build /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/nginx.conf b/nginx.conf new file mode 100644 index 0000000..0bb384f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + error_page 404 /index.html; + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires max; + log_not_found off; + } +} diff --git a/package.json b/package.json index 088f900..739bc6e 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "dev": "vite", + "start": "vite", "build": "vite build", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" diff --git a/src/component/Button.jsx b/src/component/Button.jsx new file mode 100644 index 0000000..65276ff --- /dev/null +++ b/src/component/Button.jsx @@ -0,0 +1,3 @@ +export function Button(argv) { + return ; +} diff --git a/src/component/Card.jsx b/src/component/Card.jsx new file mode 100644 index 0000000..50a27d3 --- /dev/null +++ b/src/component/Card.jsx @@ -0,0 +1,20 @@ +import { Button } from "./Button"; + +export function Postcard(argv) { + return ( +

+ {argv.name} +

+ ); +} diff --git a/src/main.jsx b/src/main.jsx index 55b8106..897a79f 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -4,12 +4,27 @@ import { App } from "./component/App.jsx"; import { Navbar } from "./component/Navbar.jsx"; import { Body } from "./component/Body.jsx"; import { Footer } from "./component/Footer.jsx"; +import { Postcard } from "./component/Card.jsx"; +import { Button } from "./component/Button.jsx"; +import chat from "./assets/chat_sex.jpg"; + +function buttoncaller(argv) { + console.log(argv); +} ReactDOM.createRoot(document.getElementById("root")).render( <> + + +