Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastapi init #22

Merged
merged 17 commits into from
Sep 27, 2024
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
29 changes: 21 additions & 8 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
FROM python:3.10-slim-bullseye
FROM python:3.11.4-slim-bullseye as prod

RUN pip install poetry==1.8.3

WORKDIR /app
COPY poetry.lock pyproject.toml /app
RUN pip install poetry==1.8.2

RUN POETRY_VIRTUALENVS_CREATE=false poetry install
COPY . /app
# Configuring poetry
RUN poetry config virtualenvs.create false
RUN poetry config cache-dir /tmp/poetry_cache

ENTRYPOINT ["python3"]
CMD ["prod.py"]
# Copying requirements of a project
COPY pyproject.toml poetry.lock /app/src/
WORKDIR /app/src

# Installing requirements
RUN --mount=type=cache,target=/tmp/poetry_cache poetry install --only main

# Copying actuall application
COPY . /app/src/
RUN --mount=type=cache,target=/tmp/poetry_cache poetry install --only main

CMD ["/usr/local/bin/python", "-m", "yet_another_calendar"]

FROM prod as dev

RUN --mount=type=cache,target=/tmp/poetry_cache poetry install
9 changes: 4 additions & 5 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# CalendarIT
Project template for [BlackSheep](https://github.com/Neoteroi/BlackSheep)
web framework to start Web APIs.
# YetAnotherCalendar
This project is created to replace Modeus/Netology calendars

## Getting started

Expand All @@ -15,7 +14,7 @@ curl -sSL https://install.python-poetry.org | python3 -

poetry install

poetry run python dev.py
poetry run python -m yet_another_calendar
```

### Running with Docker Compose
Expand All @@ -30,4 +29,4 @@ If code was changed, rebuild images:
docker compose up --build -d
```

### Open [OpenAPI](http://localhost:44777/docs)
### Open [OpenAPI](http://localhost:8000/api/docs)
Empty file removed backend/app/__init__.py
Empty file.
13 changes: 0 additions & 13 deletions backend/app/auth.py

This file was deleted.

43 changes: 0 additions & 43 deletions backend/app/binders.py

This file was deleted.

Empty file.
34 changes: 0 additions & 34 deletions backend/app/controllers/examples.py

This file was deleted.

63 changes: 0 additions & 63 deletions backend/app/controllers/modeus.py

This file was deleted.

45 changes: 0 additions & 45 deletions backend/app/controllers/netology.py

This file was deleted.

26 changes: 0 additions & 26 deletions backend/app/docs/__init__.py

This file was deleted.

56 changes: 0 additions & 56 deletions backend/app/docs/binders.py

This file was deleted.

43 changes: 0 additions & 43 deletions backend/app/errors.py

This file was deleted.

Loading
Loading