ci/cd for gitea, custom ollama url
Build and Push Docker Image / build-and-push (push) Failing after 1m38s
Build and Push Docker Image / build-and-push (push) Failing after 1m38s
This commit is contained in:
4 files changed
+1420
-1
No files matched your search
@@ -0,0 +1,46 @@
|
||||
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
|
||||
|
||||
- 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: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
# 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 . .
|
||||
|
||||
# Build with the Bun Nitro preset
|
||||
RUN NITRO_PRESET=bun bun run build
|
||||
|
||||
# Stage 2: Production
|
||||
FROM oven/bun:latest
|
||||
WORKDIR /app
|
||||
|
||||
# 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"]
|
||||
+1
-1
@@ -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']
|
||||
|
||||
Reference in new issue
Block a user