fix: Add libpq-dev and gcc dependencies to backend Dockerfile (#7136)
* 🔧 (Dockerfile): update Dockerfile to install additional dependencies (libpq-dev, gcc) required for the application to run successfully * add libpq5 to docker ffile nightly * 🔧 (docker-compose.yml): add docker-compose configuration for langflow and postgres services ♻️ (add_column_access_type_to_flow.py): refactor to use uppercase for access type enum values for consistency ♻️ (model.py): refactor to use uppercase for access type enum values for consistency * 🔧 (docker-compose.yml): remove docker-compose file as it is no longer needed for the project --------- Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
This commit is contained in:
parent
683a95948f
commit
ee43c51297
5 changed files with 12 additions and 8 deletions
|
|
@ -69,7 +69,7 @@ FROM python:3.12.3-slim AS runtime
|
|||
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get install git -y \
|
||||
&& apt-get install -y git libpq5 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ FROM python:3.12.3-slim AS runtime
|
|||
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get install git -y \
|
||||
&& apt-get install -y git libpq5 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ FROM langflowai/backend_build as backend_build
|
|||
FROM python:3.10-slim
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install git -y
|
||||
RUN apt-get update && apt-get install -y git libpq-dev gcc
|
||||
|
||||
COPY --from=backend_build /app/dist/*.whl /app/
|
||||
RUN pip install langflow-*.whl
|
||||
|
|
|
|||
|
|
@ -21,13 +21,17 @@ depends_on: Union[str, Sequence[str], None] = None
|
|||
|
||||
def upgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
access_type_enum = sa.Enum('PRIVATE', 'PUBLIC', name='access_type_enum')
|
||||
access_type_enum.create(conn, checkfirst=True)
|
||||
with op.batch_alter_table('flow', schema=None) as batch_op:
|
||||
if not migration.column_exists(table_name='flow', column_name='access_type', conn=conn):
|
||||
batch_op.add_column(sa.Column('access_type', sa.Enum('PRIVATE', 'PUBLIC', name='access_type_enum'), server_default='private', nullable=False))
|
||||
|
||||
batch_op.add_column(sa.Column('access_type', access_type_enum, server_default=sa.text("'PRIVATE'"), nullable=False))
|
||||
|
||||
def downgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
with op.batch_alter_table('flow', schema=None) as batch_op:
|
||||
if migration.column_exists(table_name='flow', column_name='access_type', conn=conn):
|
||||
batch_op.drop_column('access_type')
|
||||
|
||||
access_type_enum = sa.EnuM('PRIVATE', 'PUBLIC', name='access_type_enum')
|
||||
access_type_enum.drop(conn, checkfirst=True)
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ HEX_COLOR_LENGTH = 7
|
|||
|
||||
|
||||
class AccessTypeEnum(str, Enum):
|
||||
PRIVATE = "private"
|
||||
PUBLIC = "public"
|
||||
PRIVATE = "PRIVATE"
|
||||
PUBLIC = "PUBLIC"
|
||||
|
||||
|
||||
class FlowBase(SQLModel):
|
||||
|
|
@ -59,7 +59,7 @@ class FlowBase(SQLModel):
|
|||
values_callable=lambda enum: [member.value for member in enum],
|
||||
),
|
||||
nullable=False,
|
||||
server_default=text("'private'"),
|
||||
server_default=text("'PRIVATE'"),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue