-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: 🚀 make compose up --watch works
- Loading branch information
Showing
19 changed files
with
1,024 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM python:3.11.4-slim-bullseye as prod | ||
RUN apt-get update && apt-get install -y \ | ||
gcc \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
RUN pip install poetry==1.4.2 | ||
|
||
# Configuring poetry | ||
RUN poetry config virtualenvs.create false | ||
|
||
# Copying requirements of a project | ||
COPY pyproject.toml poetry.lock /app/src/ | ||
WORKDIR /app/src | ||
|
||
# Installing requirements | ||
RUN poetry install --only main | ||
# Removing gcc | ||
RUN apt-get purge -y \ | ||
gcc \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copying actuall application | ||
COPY . /app/src/ | ||
RUN poetry install --only main | ||
|
||
CMD ["/usr/local/bin/python", "-m", "gebwai"] | ||
|
||
FROM prod as dev | ||
|
||
RUN poetry install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from pydantic import HttpUrl | ||
from sqlmodel import SQLModel | ||
|
||
|
||
class GroupSummary(SQLModel): | ||
""" | ||
https://developers.line.biz/en/reference/messaging-api/#get-group-summary | ||
""" | ||
|
||
group_id: str | ||
group_name: str | ||
picture_url: HttpUrl | None = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from sqlmodel import Field, SQLModel | ||
from pydantic import HttpUrl | ||
|
||
|
||
class BaseLINEUser(SQLModel): | ||
user_id: str | ||
display_name: str | ||
picture_url: HttpUrl | None = None | ||
status_message: str | None = None | ||
language: str | None = None | ||
|
||
|
||
class LINEUser(BaseLINEUser, table=True): | ||
user_id: str = Field(primary_key=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import uuid as uuid_pkg | ||
from datetime import datetime | ||
|
||
from sqlmodel import Field, SQLModel, text | ||
|
||
|
||
class SeqModel(SQLModel): | ||
seq: int = Field(primary_key=True) | ||
|
||
|
||
|
||
class UUIDModel(SQLModel): | ||
id: uuid_pkg.UUID = Field( | ||
default_factory=uuid_pkg.uuid4, | ||
primary_key=True, | ||
index=True, | ||
nullable=False, | ||
sa_column_kwargs={ | ||
# "server_default": text("gen_random_uuid()"), | ||
"unique": True, | ||
}, | ||
) | ||
|
||
|
||
class TimestampModel(SQLModel): | ||
created_at: datetime = Field( | ||
nullable=False, | ||
sa_column_kwargs={"server_default": text("current_timestamp")}, | ||
) | ||
|
||
updated_at: datetime = Field( | ||
nullable=True, | ||
sa_column_kwargs={ | ||
"onupdate": text("current_timestamp"), | ||
}, | ||
) | ||
|
||
|
||
class SoftDeleteModel(SQLModel): | ||
deleted_at: datetime = Field(nullable=True) | ||
|
||
|
||
class MissingModel(SQLModel): | ||
missing_at: datetime = Field(nullable=True) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.