From 506af5b441e3a913b0bf1a317f363c92909c42c5 Mon Sep 17 00:00:00 2001 From: Neki Date: Tue, 1 Apr 2025 23:04:18 +0300 Subject: [PATCH] cringe --- compose.yml | 12 ++++++++- cool_todo_manager/dockerfile | 20 ++++++++++++++ cool_todo_manager/eslint.config.js | 2 +- cool_todo_manager/nginx/nginx.conf | 27 +++++++++++++++++++ .../src/components/MainBoard/MainBoard.tsx | 3 +-- cool_todo_manager/tsconfig.app.json | 9 +------ cool_todo_manager/tsconfig.node.json | 7 ----- 7 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 cool_todo_manager/dockerfile create mode 100644 cool_todo_manager/nginx/nginx.conf diff --git a/compose.yml b/compose.yml index 4d74047..2eb31ab 100644 --- a/compose.yml +++ b/compose.yml @@ -4,6 +4,7 @@ services: ports: - 3000:3000 restart: unless-stopped + postgres: image: postgres:latest container_name: postgres_container @@ -15,4 +16,13 @@ services: ports: - "5432:5432" volumes: - - postgres_data:/var/lib/postgresql/data \ No newline at end of file + - postgres_data:/var/lib/postgresql/data + + frontend_nginx: + build: ./cool_todo_manager + container_name: frontend_nginx + ports: + - 80:80 + environment: + - NGINX_COOL=nginx_cool + restart: unless-stopped \ No newline at end of file diff --git a/cool_todo_manager/dockerfile b/cool_todo_manager/dockerfile new file mode 100644 index 0000000..e13eb10 --- /dev/null +++ b/cool_todo_manager/dockerfile @@ -0,0 +1,20 @@ +FROM node:18-alpine AS builder + +WORKDIR /app + +COPY ./package*.json ./ + +RUN npm ci + +COPY . . + +RUN ls -lah + +RUN npm run build + +FROM nginx:latest + +COPY --from=builder /app/dist /usr/share/nginx_cool/dist +COPY --from=builder /app/nginx/nginx.conf /etc/nginx/nginx.conf + +EXPOSE 80 \ No newline at end of file diff --git a/cool_todo_manager/eslint.config.js b/cool_todo_manager/eslint.config.js index 092408a..02b28ed 100644 --- a/cool_todo_manager/eslint.config.js +++ b/cool_todo_manager/eslint.config.js @@ -5,7 +5,7 @@ import reactRefresh from 'eslint-plugin-react-refresh' import tseslint from 'typescript-eslint' export default tseslint.config( - { ignores: ['dist'] }, + { ignores: ['*'] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], files: ['**/*.{ts,tsx}'], diff --git a/cool_todo_manager/nginx/nginx.conf b/cool_todo_manager/nginx/nginx.conf new file mode 100644 index 0000000..a1bd0d8 --- /dev/null +++ b/cool_todo_manager/nginx/nginx.conf @@ -0,0 +1,27 @@ +events { + worker_connections 1024; +} + +http { + + include /etc/nginx/mime.types; + + default_type application/octet-stream; + + + server { + listen 80; + server_name _; + + root /usr/share/nginx_cool/dist; + index index.html; + + location / { + try_files $uri /index.html; + } + + location ~* \.js$ { + add_header Content-Type application/javascript; + } + } +} \ No newline at end of file diff --git a/cool_todo_manager/src/components/MainBoard/MainBoard.tsx b/cool_todo_manager/src/components/MainBoard/MainBoard.tsx index 41854df..118241c 100644 --- a/cool_todo_manager/src/components/MainBoard/MainBoard.tsx +++ b/cool_todo_manager/src/components/MainBoard/MainBoard.tsx @@ -8,8 +8,7 @@ import CardGroup from '../CardGroup/CardGroup'; import CreateProjectDialog from '../dialogs/CreateProjectDialog/CreateProjectDialog'; export default function MainBoard() { - const dragEndHandle = (result: TDragResult) => { - result; + const dragEndHandle = (result: any) => { }; const [createProject] = useCreateProjectMutation(); diff --git a/cool_todo_manager/tsconfig.app.json b/cool_todo_manager/tsconfig.app.json index 01009cf..b456a41 100644 --- a/cool_todo_manager/tsconfig.app.json +++ b/cool_todo_manager/tsconfig.app.json @@ -14,13 +14,6 @@ "moduleDetection": "force", "noEmit": true, "jsx": "react-jsx", - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true }, - "include": ["src", "../@types/**/*"] + "include": ["src"] } diff --git a/cool_todo_manager/tsconfig.node.json b/cool_todo_manager/tsconfig.node.json index db0becc..1df2998 100644 --- a/cool_todo_manager/tsconfig.node.json +++ b/cool_todo_manager/tsconfig.node.json @@ -12,13 +12,6 @@ "isolatedModules": true, "moduleDetection": "force", "noEmit": true, - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true }, "include": ["vite.config.ts"] }