Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.4.15"
enable-cache: true
- run: docker compose down -v --remove-orphans
- run: docker compose up -d db mailcatcher
- name: Migrate DB
Expand Down
29 changes: 15 additions & 14 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ FROM python:3.10

ENV PYTHONUNBUFFERED=1

WORKDIR /app/

# Install uv
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
COPY --from=ghcr.io/astral-sh/uv:0.5.11 /uv /uvx /bin/

# Place executables in the environment at the front of the path
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
ENV PATH="/app/.venv/bin:$PATH"

# Compile bytecode
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
ENV UV_COMPILE_BYTECODE=1
Expand All @@ -20,25 +14,32 @@ ENV UV_COMPILE_BYTECODE=1
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#caching
ENV UV_LINK_MODE=copy

WORKDIR /app/

# Place executables in the environment at the front of the path
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
ENV PATH="/app/.venv/bin:$PATH"

# Install dependencies
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project
uv sync --frozen --no-install-workspace --package app

ENV PYTHONPATH=/app
COPY ./backend/scripts /app/backend/scripts

COPY ./scripts /app/scripts
COPY ./backend/pyproject.toml ./backend/alembic.ini /app/backend/

COPY ./pyproject.toml ./uv.lock ./alembic.ini /app/

COPY ./app /app/app
COPY ./tests /app/tests
COPY ./backend/app /app/backend/app

# Sync the project
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --package app

WORKDIR /app/backend/

CMD ["fastapi", "run", "--workers", "4", "app/main.py"]
4 changes: 2 additions & 2 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies = [
"pyjwt<3.0.0,>=2.8.0",
]

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"pytest<8.0.0,>=7.4.3",
"mypy<2.0.0,>=1.8.0",
"ruff<1.0.0,>=0.2.2",
Expand Down
1,601 changes: 0 additions & 1,601 deletions backend/uv.lock

This file was deleted.

7 changes: 4 additions & 3 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ services:
ports:
- "8000:8000"
build:
context: ./backend
context: .
dockerfile: backend/Dockerfile
# command: sleep infinity # Infinite loop to keep container alive doing nothing
command:
- fastapi
Expand All @@ -71,15 +72,15 @@ services:
watch:
- path: ./backend
action: sync
target: /app
target: /app/backend
ignore:
- ./backend/.venv
- .venv
- path: ./backend/pyproject.toml
action: rebuild
# TODO: remove once coverage is done locally
volumes:
- ./backend/htmlcov:/app/htmlcov
- ./backend/htmlcov:/app/backend/htmlcov
environment:
SMTP_HOST: "mailcatcher"
SMTP_PORT: "1025"
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ services:
prestart:
image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'
build:
context: ./backend
context: .
dockerfile: backend/Dockerfile
networks:
- traefik-public
- default
Expand Down Expand Up @@ -115,7 +116,8 @@ services:
retries: 5

build:
context: ./backend
context: .
dockerfile: backend/Dockerfile
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const Body_login_login_access_tokenSchema = {
anyOf: [
{
type: 'string',
pattern: 'password'
pattern: '^password$'
},
{
type: 'null'
Expand All @@ -20,6 +20,7 @@ export const Body_login_login_access_tokenSchema = {
},
password: {
type: 'string',
format: 'password',
title: 'Password'
},
scope: {
Expand Down Expand Up @@ -47,6 +48,7 @@ export const Body_login_login_access_tokenSchema = {
type: 'null'
}
],
format: 'password',
title: 'Client Secret'
}
},
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.uv.workspace]
members = ["backend"]
2,043 changes: 2,043 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading