Skip to content

Commit

Permalink
Dockerfile and build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sugarforever committed Mar 5, 2024
1 parent ded0fee commit 6049193
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# Generate a timestamp and store it in a variable
- name: Generate Timestamp
id: timestamp
run: echo "::set-output name=timestamp::$(date +%s)"

- name: Build the Docker image
run: |
TIMESTAMP="${{ steps.timestamp.outputs.timestamp }}"
docker build . --file Dockerfile --tag 0001coder/chatollama:${TIMESTAMP}
docker tag 0001coder/chatollama:${TIMESTAMP} 0001coder/chatollama:latest
- name: Log in to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker image to registry
run: |
TIMESTAMP="${{ steps.timestamp.outputs.timestamp }}"
docker push 0001coder/chatollama:${TIMESTAMP}
docker push 0001coder/chatollama:latest
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG NODE_VERSION=20.5.1

FROM node:${NODE_VERSION}-slim

WORKDIR /app

COPY pnpm-lock.yaml package.json ./

RUN npm install -g pnpm

RUN pnpm i

COPY . .

RUN pnpm run build

EXPOSE 3000

CMD ["node", ".output/server/index.mjs"]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"vue-router": "^4.2.5"
},
"dependencies": {
"@iconify-json/heroicons": "^1.1.20",
"@langchain/community": "^0.0.33",
"@langchain/core": "^0.1.40",
"@langchain/openai": "^0.0.15",
Expand Down
9 changes: 6 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6049193

Please sign in to comment.