new build
This commit is contained in:
+6
-1
@@ -19,11 +19,16 @@ ENV HOSTNAME=0.0.0.0
|
||||
RUN addgroup --system --gid 1001 nodejs && \
|
||||
adduser --system --uid 1001 nextjs
|
||||
|
||||
# Standalone-сборка
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
RUN mkdir -p /app/uploads && chown nextjs:nodejs /app/uploads
|
||||
# SQLite: схема для инициализации БД при первом запуске
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/init ./init
|
||||
|
||||
# Директория для SQLite БД и загрузок (монтируется через volume)
|
||||
RUN mkdir -p /app/data /app/uploads && chown nextjs:nodejs /app/data /app/uploads
|
||||
|
||||
USER nextjs
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ const nextConfig = {
|
||||
eslint: {
|
||||
ignoreDuringBuilds: true,
|
||||
},
|
||||
compiler: {
|
||||
styledComponents: true,
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = nextConfig
|
||||
|
||||
+3
-2
@@ -5,9 +5,10 @@
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"start": "node .next/standalone/server.js",
|
||||
"preview": "npm run build && node .next/standalone/server.js",
|
||||
"lint": "next lint",
|
||||
"postbuild": "next-sitemap"
|
||||
"postbuild": "next-sitemap && node scripts/copy-standalone.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"bcrypt": "^6.0.0",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
|
||||
<url><loc>https://strike-arena.kz/admin/faq</loc><lastmod>2026-06-02T13:00:15.241Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/price</loc><lastmod>2026-06-02T13:00:15.242Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/games</loc><lastmod>2026-06-02T13:00:15.242Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/login</loc><lastmod>2026-06-02T13:00:15.242Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/hardware</loc><lastmod>2026-06-02T13:00:15.242Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/contacts</loc><lastmod>2026-06-02T13:00:15.242Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz</loc><lastmod>2026-06-02T13:00:15.242Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/policy</loc><lastmod>2026-06-02T13:00:15.242Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/contacts</loc><lastmod>2026-06-02T17:07:25.971Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/games</loc><lastmod>2026-06-02T17:07:25.972Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/login</loc><lastmod>2026-06-02T17:07:25.972Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/hardware</loc><lastmod>2026-06-02T17:07:25.972Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/price</loc><lastmod>2026-06-02T17:07:25.972Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz</loc><lastmod>2026-06-02T17:07:25.972Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/admin/faq</loc><lastmod>2026-06-02T17:07:25.972Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://strike-arena.kz/policy</loc><lastmod>2026-06-02T17:07:25.972Z</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
</urlset>
|
||||
@@ -0,0 +1,49 @@
|
||||
// Копирует нужные файлы в .next/standalone/ после билда
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
function copyDir(src, dest) {
|
||||
if (!fs.existsSync(src)) return;
|
||||
fs.mkdirSync(dest, { recursive: true });
|
||||
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
||||
const srcPath = path.join(src, entry.name);
|
||||
const destPath = path.join(dest, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
copyDir(srcPath, destPath);
|
||||
} else {
|
||||
fs.copyFileSync(srcPath, destPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function copyFile(src, dest) {
|
||||
if (!fs.existsSync(src)) return;
|
||||
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
||||
fs.copyFileSync(src, dest);
|
||||
console.log(` ✓ ${path.basename(src)}`);
|
||||
}
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
const standalone = path.join(root, '.next', 'standalone');
|
||||
|
||||
console.log('Копирую файлы в .next/standalone/...');
|
||||
|
||||
// public/ → .next/standalone/public/
|
||||
copyDir(path.join(root, 'public'), path.join(standalone, 'public'));
|
||||
console.log(' ✓ public/');
|
||||
|
||||
// .next/static/ → .next/standalone/.next/static/
|
||||
copyDir(path.join(root, '.next', 'static'), path.join(standalone, '.next', 'static'));
|
||||
console.log(' ✓ .next/static/');
|
||||
|
||||
// init/ → .next/standalone/init/ (нужно для SQLite seed)
|
||||
copyDir(path.join(root, 'init'), path.join(standalone, 'init'));
|
||||
console.log(' ✓ init/');
|
||||
|
||||
// .env.local → .next/standalone/.env.local (переменные окружения для локального запуска)
|
||||
copyFile(path.join(root, '.env.local'), path.join(standalone, '.env.local'));
|
||||
|
||||
// .env → .next/standalone/.env (если есть)
|
||||
copyFile(path.join(root, '.env'), path.join(standalone, '.env'));
|
||||
|
||||
console.log('✓ standalone готов к запуску');
|
||||
Reference in New Issue
Block a user