Skip to content

Commit

Permalink
Merge pull request #1 from rtuszik/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rtuszik authored Aug 23, 2024
2 parents 2c4f5e6 + 614e912 commit 07c08aa
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 106 deletions.
39 changes: 39 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.DS_Store
**/__pycache__
**/.venv
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.github
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
.github
.git
.docker-compose.yml
.gitignore
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REPLICATE_API_TOKEN=yourtokenhere
REPLICATE_API_TOKEN=your_replicate_api_token
HOST_OUTPUT_DIR=/path/to/your/output/directory
42 changes: 42 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Build and Push

on:
push:
branches:
- main

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

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

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1

ENV PYTHONUNBUFFERED=1

WORKDIR /app

RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser

COPY requirements.txt .

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt

USER appuser

COPY src/ .

EXPOSE 8080

CMD [ "python", "main.py" ]
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

services:
flux-replicate-gui:
image: ghcr.io/rtuszik:
container_name: flux-replicate-gui
environment:
- REPLICATE_API_TOKEN=${REPLICATE_API_TOKEN}
ports:
- "8080:8080"
volumes:
- ${HOST_OUTPUT_DIR}:/app/output
restart: unless-stopped
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ token_count==0.2.1
pillow==10.4.0
loguru==0.7.2
nicegui==1.4.36
httpx
httpx==0.27.0
2 changes: 1 addition & 1 deletion src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def setup_ui(self):
with ui.column().classes("w-full max-w-7xl mx-auto p-4 space-y-4"):
with ui.card().classes("w-full"):
ui.label("Image Generator").classes("text-2xl font-bold mb-4")
with ui.row().classes("w-full justify-between"):
with ui.row().classes("w-full"):
with ui.column().classes("w-1/2 pr-2"):
self.setup_left_panel()
with ui.column().classes("w-1/2 pl-2"):
Expand Down
80 changes: 0 additions & 80 deletions src/utils.py

This file was deleted.

0 comments on commit 07c08aa

Please sign in to comment.