Skip to content

Commit 1744a1c

Browse files
committed
release
0 parents  commit 1744a1c

19 files changed

+3368
-0
lines changed

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM node as vite-app
2+
3+
WORKDIR /app/client
4+
COPY ./client .
5+
6+
RUN ["npm", "i"]
7+
RUN ["npm", "run", "build"]
8+
9+
FROM nginx:alpine
10+
11+
WORKDIR /usr/share/nginx/
12+
13+
RUN rm -rf html
14+
RUN mkdir html
15+
16+
WORKDIR /
17+
18+
COPY ./nginx/nginx.conf /etc/nginx
19+
COPY --from=vite-app ./app/client/dist /usr/share/nginx/html
20+
21+
ENTRYPOINT ["nginx", "-g", "daemon off;"]

Readme.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# NGINX + React + Vite + TypeScript
2+
3+
This repo is my sample of React + Vite + TypeScript + Nginx + Docker + DockerCompose
4+
5+
## Project Hierarchy Review
6+
7+
nginx_vite_react
8+
├─ client
9+
│ ├─ public
10+
│ │ └─ vite.svg
11+
│ ├─ src
12+
│ │ ├─ assets
13+
│ │ │ └─ react.svg
14+
│ │ ├─ App.css
15+
│ │ ├─ index.css
16+
│ │ ├─ main.tsx
17+
│ │ └─ vite-env.ts
18+
│ ├─ .eslintrc.cjs
19+
│ ├─ index.html
20+
│ ├─ package.json
21+
│ ├─ package.lock.json
22+
│ ├─ tsconfig.json
23+
│ ├─ tsconfig.node.json
24+
│ └─ vite.config.json
25+
├─ nginx
26+
│ └─ nginx.conf
27+
├─ .gitignore
28+
├─ docker-compose.yml
29+
└─ Readme.md
30+
31+
## Installation (on host)
32+
33+
- First change work directory<br/>
34+
<code>$ cd client</code><br/>
35+
36+
- Second install node_modules dependencies<br/>
37+
<code>$ npm i</code><br/>
38+
39+
- Third start dev server<br/>
40+
<code>$ npm run dev</code><br/>
41+
42+
## Run in Docker-compose
43+
44+
- First input in terminan command<br/>
45+
<code>$ docker image build -f Dockerfile -t vite_react . </code>
46+
<i>or sudo:</i>
47+
<code># sudo docker image build -f Dockerfile -t vite_react . </code>
48+
49+
- Second input next<br/>
50+
<code>$ docker compose -f docker-compose.yml -p <i>serve</i> up</code>
51+
52+
- Use it!
53+
54+
<i>serve</i> - is name of project started in docker-compose
55+
56+
<i>maded by <a href='https://github.com/letnull19A'>@letnull19a</a></i>

client/.eslintrc.cjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['react-refresh'],
12+
rules: {
13+
'react-refresh/only-export-components': [
14+
'warn',
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
}

client/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)