generated from MinBZK/python-project-template
-
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.
- Loading branch information
1 parent
0844f5c
commit 7ce67b2
Showing
13 changed files
with
66 additions
and
85 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
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
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
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 |
---|---|---|
|
@@ -3,8 +3,8 @@ ARG PYTHON_VERSION=3.11.7-slim | |
FROM --platform=$BUILDPLATFORM python:${PYTHON_VERSION} as project-base | ||
|
||
LABEL [email protected] \ | ||
organization=MinBZK \ | ||
license=EUPL-1.2 | ||
organization=MinBZK \ | ||
license=EUPL-1.2 | ||
|
||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
|
@@ -16,7 +16,7 @@ ENV PYTHONUNBUFFERED=1 \ | |
POETRY_HOME='/usr/local' | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
curl libpq-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
@@ -46,11 +46,8 @@ FROM project-base as production | |
|
||
COPY . /app/ | ||
|
||
EXPOSE 8000 | ||
RUN poetry install | ||
|
||
ENV PYTHONPATH=/app/ | ||
WORKDIR /app/tad/ | ||
WORKDIR /app/ | ||
|
||
# change this to a usefull command | ||
CMD ["python", "-m", "uvicorn", "main:app" ] | ||
CMD ["python", "-m", "uvicorn", "--host", "0.0.0.0", "tad.main:app" ] |
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
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 |
---|---|---|
@@ -1,49 +1,52 @@ | ||
"""empty message | ||
Revision ID: 99fb931b1324 | ||
Revises: | ||
Revises: | ||
Create Date: 2024-05-02 12:04:56.694709 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
from collections.abc import Sequence | ||
|
||
import sqlalchemy as sa | ||
import sqlmodel.sql.sqltypes | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '99fb931b1324' | ||
down_revision: Union[str, None] = None | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
revision: str = "99fb931b1324" | ||
down_revision: str | None = None | ||
branch_labels: str | Sequence[str] | None = None | ||
depends_on: str | Sequence[str] | None = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('hero', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.Column('secret_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.Column('age', sa.Integer(), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
op.create_table( | ||
"hero", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.Column("secret_name", sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.Column("age", sa.Integer(), nullable=True), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.create_table('user', | ||
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.Column('is_active', sa.Boolean(), nullable=False), | ||
sa.Column('is_superuser', sa.Boolean(), nullable=False), | ||
sa.Column('full_name', sqlmodel.sql.sqltypes.AutoString(), nullable=True), | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('hashed_password', sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.PrimaryKeyConstraint('id') | ||
op.create_table( | ||
"user", | ||
sa.Column("email", sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.Column("is_active", sa.Boolean(), nullable=False), | ||
sa.Column("is_superuser", sa.Boolean(), nullable=False), | ||
sa.Column("full_name", sqlmodel.sql.sqltypes.AutoString(), nullable=True), | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("hashed_password", sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True) | ||
op.create_index(op.f("ix_user_email"), "user", ["email"], unique=True) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f('ix_user_email'), table_name='user') | ||
op.drop_table('user') | ||
op.drop_table('hero') | ||
op.drop_index(op.f("ix_user_email"), table_name="user") | ||
op.drop_table("user") | ||
op.drop_table("hero") | ||
# ### end Alembic commands ### |
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
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