Skip to content

Commit

Permalink
INITIAL COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreteles committed Oct 25, 2023
0 parents commit 9cc78a2
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build and Publish Docker Image

on:
push:
branches: [main]
schedule:
- cron: "24 9 * * 6"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_TAG: ${{ github.sha }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout Dockerfile
id: checkout
uses: actions/checkout@v4

- name: Setup QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
id: ghcr
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ startsWith(github.ref, 'refs/heads/main') }}
suffix=-${{ github.sha }}
- name: Build and push main Docker image
id: build
uses: docker/build-push-action@v5
with:
build-args: GH_TOKEN=${{ secrets.GH_TOKEN }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64/v8
cache-to: type=gha,mode=max,ignore-error=true
cache-from: type=gha
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM python:3.10-slim

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends curl gcc g++ git make && \
apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
pip install langflow>=0.5.3 && \
pip cache purge && \
rm -rf /root/.cache/pip && \
useradd -m -u 1000 langflow && \
mkdir -p /home/langflow/app && \
chown -R langflow:langflow /home/langflow

USER langflow

ENV HOME=/home/langflow

COPY --chown=langflow:langflow run.sh $HOME/app/run.sh

WORKDIR $HOME/app

ENTRYPOINT ["./run.sh"]

HEALTHCHECK CMD curl --fail http://0.0.0.0:7860/ || exit 1

EXPOSE 7860
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TO-DO
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

version: '3.8'
services:
langflow:
image: Sideral-tech/langflow-docker:latest
restart: unless-stopped
ports:
- 127.0.0.1:7860:7860
volumes:
- /data/langflow/data:/home/langflow/.cache/langflow
- /data/langflow/logs:/home/langflow/app/logs
6 changes: 6 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

langflow run \
--workers "$(nproc --all)" \
--host 0.0.0.0 \
--port 7860

0 comments on commit 9cc78a2

Please sign in to comment.