Add Docker deploy for Dokploy and fix the home banner template.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-09 17:45:23 +03:30
co-authored by Cursor
parent a7f9c66514
commit 2c688753d3
6 changed files with 56 additions and 4 deletions
+10
View File
@@ -0,0 +1,10 @@
node_modules
dist
.git
.gitignore
.env
.env.local
*.log
.vscode
.idea
coverage
+1
View File
@@ -0,0 +1 @@
VITE_API_BASE_URL=https://parche.montest.ir/server/api
+16
View File
@@ -0,0 +1,16 @@
# داک‌پلوی: Build Type = Dockerfile ، پورت ۸۰
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
ARG VITE_API_BASE_URL=https://parche.montest.ir/server/api
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
RUN npm run build-only
FROM nginx:1.27-alpine
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
+19
View File
@@ -0,0 +1,19 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
location /assets/ {
expires 7d;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
location / {
try_files $uri $uri/ /index.html;
}
}
+7 -1
View File
@@ -70,6 +70,12 @@ let bannerTimer: number | undefined
const banner = computed(() => banners.value[bannerIndex.value] ?? FALLBACK_BANNER)
const heroStyle = computed(() => {
const image = banner.value.imageUrl
if (!image) return undefined
return { '--hero-image': `url("${image}")` }
})
function startBannerRotation() {
stopBannerRotation()
if (banners.value.length < 2) return
@@ -193,7 +199,7 @@ async function toggleFavorite(productId: string) {
<section
class="hero-banner"
:aria-label="banner.title"
:style="banner.imageUrl ? { '--hero-image': `url(\"${banner.imageUrl}\")` } : undefined"
:style="heroStyle"
>
<div class="hero-banner__content">
<h2 class="hero-banner__title">
+3 -3
View File
@@ -7,12 +7,12 @@ import vueDevTools from 'vite-plugin-vue-devtools'
import UnoCSS from '@unocss/vite'
// https://vite.dev/config/
export default defineConfig({
export default defineConfig(({ mode }) => ({
plugins: [
vue(),
vueJsx(),
UnoCSS(),
vueDevTools(),
...(mode === 'development' ? [vueDevTools()] : []),
],
resolve: {
alias: {
@@ -28,4 +28,4 @@ export default defineConfig({
},
},
},
})
}))