Compare commits

...
5 Commits
Author SHA1 Message Date
thumapas 337dccc077 Updated prompt for translategemma
Build and Push Docker Image / build-and-push (push) Successful in 2m19s
2026-09-29 11:25:37 +02:00
thumapas d7b99dd4b7 Added gitea svg 2026-09-29 11:25:18 +02:00
thumapas 6c650bacf2 Added link to gitea repository 2026-09-29 11:25:05 +02:00
thumapas afe9b061b1 added platform support for arm in building
Build and Push Docker Image / build-and-push (push) Successful in 2m51s
2026-09-29 10:21:33 +02:00
thumapas c0b582debb ci/cd for gitea, custom ollama url
Build and Push Docker Image / build-and-push (push) Successful in 32s
2026-09-29 10:12:38 +02:00
8 changed files with 1486 additions and 5 deletions

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
env:
REGISTRY: gitea.pascalyazid.com
IMAGE_NAME: pascalyazid/quick-ling
TAG: latest
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ env.TAG }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
OLLAMA_URL=${{ secrets.OLLAMA_URL }}
+34
View File
@@ -0,0 +1,34 @@
# Stage 1: Build
FROM oven/bun:latest AS builder
WORKDIR /app
# Copy dependency files and install
COPY package.json bun.lockb* ./
RUN bun install
# Copy source code
COPY . .
ARG OLLAMA_URL
ENV OLLAMA_URL=$OLLAMA_URL
# Build with the Bun Nitro preset
RUN NITRO_PRESET=bun bun run build
# Stage 2: Production
FROM oven/bun:latest
WORKDIR /app
ENV NODE_ENV=production
# Copy only the built output from the builder stage
COPY --from=builder /app/.output ./.output
# Tell Nuxt to bind to all network interfaces inside the container
ENV HOST=0.0.0.0
ENV PORT=3000
EXPOSE 3000
# Execute the server entrypoint
CMD ["bun", "run", ".output/server/index.mjs"]
+7 -2
View File
@@ -45,9 +45,14 @@ function handleModelUpdate(newModel: string) {
<footer class="app-footer">
<div class="container">
<p>Powered by
<NuxtLink to ="https://ollama.com/library/translategemma" class="nav-link">translategemma</NuxtLink>
<NuxtLink to ="https://ollama.com/library/translategemma" class="nav-link"> translategemma </NuxtLink>
&bull;
<NuxtLink to ="https://ollama.com" class="nav-link">ollama</NuxtLink></p>
<NuxtLink to ="https://ollama.com" class="nav-link"> ollama </NuxtLink>
&bull;
<NuxtLink to="https://gitea.pascalyazid.com/pascalyazid/Quick-Ling" class="nav-link"> Source Code <img src="/gitea.svg" alt="gitea" width="40" height="16" /></NuxtLink>
</p>
</div>
</footer>
+1344
View File
File diff suppressed because it is too large. Load diff
+13
View File
@@ -0,0 +1,13 @@
version: '3.8'
services:
nuxt-app:
image: gitea.pascalyazid.com/pascalyazid/quick-ling:latest
container_name: nuxt-bun-app
restart: unless-stopped
ports:
- "${PORT:-3000}:3000"
environment:
- OLLAMA_URL
+1 -1
View File
@@ -16,7 +16,7 @@ export default defineNuxtConfig({
}
},
runtimeConfig: {
ollamahost: 'http://localhost:11434',
ollamahost: process.env.OLLAMA_URL || 'http://localhost:11434',
ollamamodel: 'translategemma:4b'
},
css: ['~/assets/css/main.css']
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 120 640 420" style="enable-background:new 0 120 640 420;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+4 -2
View File
@@ -66,9 +66,11 @@ export default defineEventHandler(async (event) => {
? body.model
: config.ollamamodel;
const prompt = `Translate the following text from ${body.source} to ${body.target}. Only output the translation, nothing else.
const prompt = `You are a professional ${body.source} to ${body.target} translator. Your goal is to accurately convey the meaning and nuances of the original ${body.source} text while adhering to {TARGET_LANG} grammar, vocabulary, and cultural sensitivities.
Produce only the ${body.target} translation, without any additional explanations or commentary. Please translate the following ${body.source} text into ${body.target}:
Text to translate: ${body.text}`;
${body.text}`;
const ollamaRequest: OllamaRequest = {
model,