Skip to content

Commit

Permalink
release: 2.0.69
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Dec 28, 2023
1 parent e1d781f commit 3663b0b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

All notables change for Cocoa Discord Utils will be noted here

## [1.1.69] - 2023-12-28
## [2.0.69] - 2023-12-28

- feat: perspective transformation by @WasinUddy
- refactor: removed PosOption, image if cropped will always center
- feat!: wessuwan.png is remade
- feat: NEW FRAME! orz.jpg
- feat: added new frame orz.jpg
- feat!: updated pos options

## [1.0.51] - 2022-06-20
Expand Down
40 changes: 24 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use a base image with Python and necessary dependencies
FROM python:3.11-slim-bookworm
# ? OpenCV Dependencies, probably needed in all images
FROM python:3.11-slim-bookworm as base

# Install system dependencies for OpenCV
RUN apt-get update && apt-get install -y \
Expand All @@ -8,29 +8,37 @@ RUN apt-get update && apt-get install -y \
libxext6 \
libxrender-dev

# Set working directory
WORKDIR /app

# Copy project metadata files and source files
COPY pyproject.toml poetry.lock ./
COPY golden_frame ./golden_frame
# ? Builder
FROM base as builder

# Install Poetry and project dependencies
RUN pip install poetry

# https://medium.com/@albertazzir/blazing-fast-python-docker-builds-with-poetry-a78a66f5aed0
RUN pip install poetry
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

RUN poetry config virtualenvs.create false
WORKDIR /app

# Copy source files
COPY pyproject.toml poetry.lock ./
COPY golden_frame ./golden_frame

RUN poetry install && rm -rf $POETRY_CACHE_DIR

# # Install system package dependencies for OpenCV
# RUN poetry run apt-get update && apt-get install -y \
# libopencv-dev
# ? Runner
FROM base as runner

USER nobody
WORKDIR /app

ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"

COPY --from=builder --chown=nobody:nobody ${VIRTUAL_ENV} ${VIRTUAL_ENV}

COPY --chown=nobody:nobody golden_frame ./golden_frame

# Set entry point (adjust accordingly)
EXPOSE 3131
CMD ["poetry", "run", "python", "-u", "golden_frame/server.py"]
CMD ["python", "-u", "golden_frame/server.py"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ Currently, to add images, add them directly in assets folder.
You can get its location with this command

```python
import os
from pkg_resources import get_distribution
location = get_distribution("golden-frame").location
ASSET_PATH = os.path.join(location, "golden_frame/assets")
print(ASSET_PATH)
```

Note that this is temporary and can be overwrite when installing new version.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "golden-frame"
version = "1.1.69rc1"
version = "2.0.69"
description = "Golden Frame \"กรอบทอง\" Generator, Create Golden Frame for given images (Also supports other frame, included with selected quality frames)"
authors = [
"Nutthapat Pongtanyavichai <59821765+Leomotors@users.noreply.github.com>",
Expand Down

0 comments on commit 3663b0b

Please sign in to comment.