Add Docker deploy for Dokploy and fix the home banner template.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
*.log
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
coverage
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
VITE_API_BASE_URL=https://parche.montest.ir/server/api
|
||||||
+16
@@ -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
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -70,6 +70,12 @@ let bannerTimer: number | undefined
|
|||||||
|
|
||||||
const banner = computed(() => banners.value[bannerIndex.value] ?? FALLBACK_BANNER)
|
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() {
|
function startBannerRotation() {
|
||||||
stopBannerRotation()
|
stopBannerRotation()
|
||||||
if (banners.value.length < 2) return
|
if (banners.value.length < 2) return
|
||||||
@@ -193,7 +199,7 @@ async function toggleFavorite(productId: string) {
|
|||||||
<section
|
<section
|
||||||
class="hero-banner"
|
class="hero-banner"
|
||||||
:aria-label="banner.title"
|
:aria-label="banner.title"
|
||||||
:style="banner.imageUrl ? { '--hero-image': `url(\"${banner.imageUrl}\")` } : undefined"
|
:style="heroStyle"
|
||||||
>
|
>
|
||||||
<div class="hero-banner__content">
|
<div class="hero-banner__content">
|
||||||
<h2 class="hero-banner__title">
|
<h2 class="hero-banner__title">
|
||||||
|
|||||||
+3
-3
@@ -7,12 +7,12 @@ import vueDevTools from 'vite-plugin-vue-devtools'
|
|||||||
import UnoCSS from '@unocss/vite'
|
import UnoCSS from '@unocss/vite'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => ({
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
UnoCSS(),
|
UnoCSS(),
|
||||||
vueDevTools(),
|
...(mode === 'development' ? [vueDevTools()] : []),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
@@ -28,4 +28,4 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user