Compare commits
2
Commits
v0.1
..
afe9b061b1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afe9b061b1 | ||
|
|
c0b582debb |
No files matched your search
@@ -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
@@ -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"]
|
||||||
@@ -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
@@ -16,7 +16,7 @@ export default defineNuxtConfig({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
ollamahost: 'http://localhost:11434',
|
ollamahost: process.env.OLLAMA_URL || 'http://localhost:11434',
|
||||||
ollamamodel: 'translategemma:4b'
|
ollamamodel: 'translategemma:4b'
|
||||||
},
|
},
|
||||||
css: ['~/assets/css/main.css']
|
css: ['~/assets/css/main.css']
|
||||||
|
|||||||
Reference in new issue
Block a user