fix docker for tauri app
This commit is contained in:
@@ -1272,7 +1272,6 @@ export default function LoginPage() {
|
|||||||
|
|
||||||
<a
|
<a
|
||||||
href="/download/android"
|
href="/download/android"
|
||||||
download
|
|
||||||
className="mx-auto mt-3 flex w-fit items-center gap-1 rounded-full px-3 py-1.5 text-xs font-medium text-[#b9bdc9] transition hover:bg-white/10 hover:text-white"
|
className="mx-auto mt-3 flex w-fit items-center gap-1 rounded-full px-3 py-1.5 text-xs font-medium text-[#b9bdc9] transition hover:bg-white/10 hover:text-white"
|
||||||
>
|
>
|
||||||
<Download className="h-3.5 w-3.5" />
|
<Download className="h-3.5 w-3.5" />
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import { createReadStream, existsSync, statSync } from 'node:fs';
|
import { createReadStream, existsSync, statSync } from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { Readable } from 'node:stream';
|
import { Readable } from 'node:stream';
|
||||||
import { NextResponse } from 'next/server';
|
|
||||||
|
|
||||||
export const runtime = 'nodejs';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
const APK_CANDIDATES = [
|
const APK_CANDIDATES = [
|
||||||
process.env.TAURI_ANDROID_APK_PATH,
|
process.env.TAURI_ANDROID_APK_PATH,
|
||||||
path.resolve(process.cwd(), 'public/downloads/lendry-id.apk'),
|
path.resolve(process.cwd(), 'public/downloads/lendry-id.apk'),
|
||||||
|
path.resolve(process.cwd(), 'apps/frontend/public/downloads/lendry-id.apk'),
|
||||||
|
'/app/apps/frontend/public/downloads/lendry-id.apk',
|
||||||
|
'/app/public/downloads/lendry-id.apk',
|
||||||
path.resolve(process.cwd(), '../../tauri_app/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk'),
|
path.resolve(process.cwd(), '../../tauri_app/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk'),
|
||||||
path.resolve(process.cwd(), '../../tauri_app/src-tauri/gen/android/app/build/outputs/apk/universal/debug/app-universal-debug.apk'),
|
path.resolve(process.cwd(), '../../tauri_app/src-tauri/gen/android/app/build/outputs/apk/universal/debug/app-universal-debug.apk'),
|
||||||
path.resolve(process.cwd(), '../../tauri_app/src-tauri/gen/android/app/build/outputs/apk/arm64/release/app-arm64-release.apk'),
|
path.resolve(process.cwd(), '../../tauri_app/src-tauri/gen/android/app/build/outputs/apk/arm64/release/app-arm64-release.apk'),
|
||||||
@@ -21,12 +23,15 @@ function resolveApkPath() {
|
|||||||
export async function GET() {
|
export async function GET() {
|
||||||
const apkPath = resolveApkPath();
|
const apkPath = resolveApkPath();
|
||||||
if (!apkPath) {
|
if (!apkPath) {
|
||||||
return NextResponse.json(
|
return new Response(
|
||||||
|
'APK ещё не собран. Запустите: docker compose up --build tauri-apk-builder. После сборки файл появится как apps/frontend/public/downloads/lendry-id.apk.',
|
||||||
{
|
{
|
||||||
message:
|
status: 404,
|
||||||
'APK ещё не собран. Соберите tauri_app для Android или укажите TAURI_ANDROID_APK_PATH/public/downloads/lendry-id.apk.'
|
headers: {
|
||||||
|
'Content-Type': 'text/plain; charset=utf-8',
|
||||||
|
'Cache-Control': 'no-store'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ status: 404 }
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:3002:3000"
|
- "127.0.0.1:3002:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./apps/frontend/public/downloads:/app/public/downloads:ro
|
- ./apps/frontend/public/downloads:/app/apps/frontend/public/downloads:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
api-gateway:
|
api-gateway:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
Reference in New Issue
Block a user