1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

Fix project test gitlab and deployment

This commit is contained in:
MoonTestUse1
2025-01-07 07:42:24 +06:00
parent 511ec1c55c
commit eaafb9cf8f
3 changed files with 44 additions and 54 deletions

View File

@@ -1,6 +1,7 @@
# Build stage # Build stage
FROM node:18-alpine AS build FROM node:18 as build-stage
# Set working directory
WORKDIR /app WORKDIR /app
# Copy package files # Copy package files
@@ -9,29 +10,25 @@ COPY package*.json ./
# Install dependencies # Install dependencies
RUN npm install RUN npm install
# Copy source code # Copy project files
COPY . . COPY . .
# Install Vue compiler globally # Install Vue dependencies
RUN npm install -g @vue/compiler-sfc RUN npm install vue@latest @vitejs/plugin-vue vue-tsc typescript
# Set environment variables
ENV NODE_ENV=production
ENV VITE_API_URL=/api
# Build the application with increased memory limit # Build the application with increased memory limit
RUN NODE_OPTIONS="--max-old-space-size=4096" npm run build RUN NODE_OPTIONS="--max-old-space-size=4096" npm run build
# Production stage # Production stage
FROM nginx:alpine FROM nginx:stable-alpine as production-stage
# Copy built files from build stage # Copy built files
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build-stage /app/dist /usr/share/nginx/html
# Copy nginx configuration # Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80 # Expose port
EXPOSE 80 EXPOSE 80
# Start nginx # Start nginx

View File

@@ -1,42 +1,32 @@
{ {
"name": "employee-request-system-frontend", "name": "admin-portal",
"version": "1.0.0",
"description": "Frontend for Employee Request System",
"private": true, "private": true,
"version": "0.0.0",
"type": "module",
"scripts": { "scripts": {
"start": "react-scripts start", "dev": "vite",
"build": "react-scripts build", "build": "vue-tsc --noEmit && vite build",
"test": "react-scripts test --watchAll=false --passWithNoTests", "preview": "vite preview",
"eject": "react-scripts eject" "test": "echo \"No tests configured yet\" && exit 0"
}, },
"dependencies": { "dependencies": {
"react": "^18.2.0", "@vueuse/core": "^10.9.0",
"react-dom": "^18.2.0", "axios": "^1.6.2",
"react-router-dom": "^6.21.1", "chart.js": "^4.4.1",
"react-scripts": "5.0.1", "lucide-vue-next": "^0.344.0",
"axios": "^1.6.5" "pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
}, },
"devDependencies": { "devDependencies": {
"@testing-library/jest-dom": "^5.17.0", "@tailwindcss/forms": "^0.5.7",
"@testing-library/react": "^13.4.0", "@types/node": "^20.17.11",
"@testing-library/user-event": "^13.5.0" "@vitejs/plugin-vue": "^5.0.4",
}, "autoprefixer": "^10.4.18",
"eslintConfig": { "postcss": "^8.4.35",
"extends": [ "tailwindcss": "^3.4.1",
"react-app", "typescript": "^5.2.2",
"react-app/jest" "vite": "^5.1.4",
] "vue-tsc": "^2.0.6"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
} }
} }

View File

@@ -9,23 +9,26 @@ export default defineConfig({
plugins: [vue()], plugins: [vue()],
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, './src'), '@': path.resolve(__dirname, 'src'),
}, },
}, },
optimizeDeps: { build: {
include: ['axios'] chunkSizeWarningLimit: 1600,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return 'vendor';
}
}
}
}
}, },
server: { server: {
host: true,
port: 5173,
watch: {
usePolling: true
},
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:8000', target: 'http://localhost:8000',
changeOrigin: true, changeOrigin: true,
secure: false
} }
} }
} }