From 23e20a7b149c9599ae9fce01d1013dda22ad4c93 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sun, 9 Feb 2025 18:45:41 +0200 Subject: [PATCH] docker support and simplified tsconfig --- Dockerfile | 25 +++++++++++++++++++++++++ docker-compose.yml | 12 ++++++++++++ tsconfig.app.json | 33 --------------------------------- tsconfig.json | 25 ++++++++++++++++++++----- tsconfig.node.json | 24 ------------------------ tsconfig.tsbuildinfo | 1 + vite.config.ts | 4 ++++ 7 files changed, 62 insertions(+), 62 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml delete mode 100644 tsconfig.app.json delete mode 100644 tsconfig.node.json create mode 100644 tsconfig.tsbuildinfo diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..288ab7c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM node:20-alpine + +ARG VITE_OPEN_WEATHER_KEY +ARG VITE_OPEN_WEATHER_LAT +ARG VITE_OPEN_WEATHER_LON +ARG VITE_UNSPLASH_ACCESS_KEY + +ENV VITE_OPEN_WEATHER_KEY=$VITE_OPEN_WEATHER_KEY +ENV VITE_OPEN_WEATHER_LAT=$VITE_OPEN_WEATHER_LAT +ENV VITE_OPEN_WEATHER_LON=$VITE_OPEN_WEATHER_LON +ENV VITE_UNSPLASH_ACCESS_KEY=$VITE_UNSPLASH_ACCESS_KEY + +WORKDIR /app +COPY package*.json . +RUN npm install + +COPY public ./public +COPY src ./src +COPY index.html . +COPY tsconfig.json . +COPY postcss.config.cjs . +COPY vite.config.ts . + +CMD ["npm", "run", "dev"] +EXPOSE 3000 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6a32ced --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +services: + vertex: + build: + context: . + container_name: vertex + ports: + - "3003:3000" + volumes: + - ./data:/app/data/ + env_file: + - .env + restart: unless-stopped diff --git a/tsconfig.app.json b/tsconfig.app.json deleted file mode 100644 index fa2a0f7..0000000 --- a/tsconfig.app.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "jsx": "react-jsx", - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true, - "baseUrl": ".", - "paths": { - "~/*": ["src/*"], - }, - "types": [ - "@modyfi/vite-plugin-yaml/modules" - ] - }, - "include": ["src"] -} diff --git a/tsconfig.json b/tsconfig.json index 1ffef60..f3a3f6b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,22 @@ { - "files": [], - "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } - ] + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "jsx": "react-jsx", + "moduleResolution": "bundler", + "skipLibCheck": true, + "isolatedModules": true, + "noEmit": true, + "strict": true, + "baseUrl": ".", + "paths": { + "~/*": ["src/*"], + }, + "types": [ + "@modyfi/vite-plugin-yaml/modules" + ] + }, + "include": ["src"] } diff --git a/tsconfig.node.json b/tsconfig.node.json deleted file mode 100644 index 54bb9c2..0000000 --- a/tsconfig.node.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", - "target": "ES2022", - "lib": ["ES2023"], - "module": "ESNext", - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true, - }, - "include": ["vite.config.ts"] -} diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo new file mode 100644 index 0000000..309926e --- /dev/null +++ b/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./src/app.tsx","./src/atoms.ts","./src/config.ts","./src/main.tsx","./src/types.ts","./src/vite-env.d.ts","./src/api/get-app-icon.ts","./src/api/get-apps.ts","./src/api/get-search-providers.ts","./src/api/open-weather.ts","./src/api/unsplash.ts","./src/components/apps/app-button.tsx","./src/components/apps/app-list.tsx","./src/components/ui/background.tsx","./src/components/ui/sidebar.tsx","./src/components/widgets/current-image-widget.tsx","./src/components/widgets/date-widget.tsx","./src/components/widgets/favorite-background.tsx","./src/components/widgets/search-widget.tsx","./src/components/widgets/settings.tsx","./src/components/widgets/weather-widget.tsx","./src/lib/array.ts","./src/lib/date.ts","./src/lib/load-image.ts","./src/lib/math.ts","./src/lib/use-active-category.ts","./src/pages/index-page.tsx"],"version":"5.7.3"} \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index d9d5172..42ac38b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,10 @@ import path from 'path'; // https://vite.dev/config/ export default defineConfig({ plugins: [react(), ViteYaml()], + server: { + port: 3000, + host: '0.0.0.0', + }, resolve: { alias: { '~': path.resolve(__dirname, './src/'),