Skip to content

Commit

Permalink
Fix Azamat's docker-compose.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
depocoder committed Sep 27, 2024
1 parent 07b0999 commit 924d771
Show file tree
Hide file tree
Showing 11 changed files with 301 additions and 140 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# CalendarIT
# YetAnotherCalendar

12 changes: 0 additions & 12 deletions backend/Dockerfile_temp

This file was deleted.

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)
35 changes: 0 additions & 35 deletions backend/dev.py

This file was deleted.

13 changes: 0 additions & 13 deletions backend/docker-compose.dev.yml

This file was deleted.

29 changes: 0 additions & 29 deletions backend/docker-compose.yml

This file was deleted.

265 changes: 264 additions & 1 deletion backend/poetry.lock

Large diffs are not rendered by default.

33 changes: 0 additions & 33 deletions backend/prod.py

This file was deleted.

4 changes: 4 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ httptools = "^0.6.1"
pymongo = "^4.8.0"
loguru = "^0"
mypy = "^1.11.2"
environs = "^11.0.0"
beautifulsoup4 = "^4.12.3"
lxml = "^5.3.0"
httpx = {extras = ["http2"], version = "^0.27.2"}


[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion backend/yet_another_calendar/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Settings(BaseSettings):
# quantity of workers for uvicorn
workers_count: int = 1
# Enable uvicorn reloading
reload: bool = True
reload: bool = env.bool("YET_ANOTHER_CALENDAR_RELOAD", False)

# Current environment
environment: str = "dev"
Expand Down
37 changes: 27 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
services:
backend:
api: &main_app
ports:
- "8000:8000"
build:
context: ./backend
container_name: calendar-backend
context: backend/
dockerfile: Dockerfile
image: yet_another_calendar:${YET_ANOTHER_CALENDAR_VERSION:-latest}
restart: always
environment:
APP_HOST: "0.0.0.0"
APP_PORT: "8000"
volumes:
- ./backend:/app/
ports:
- "127.0.0.1:8000:8000"
- ./backend:/app/src/
env_file:
- backend/.env
depends_on:
redis:
condition: service_healthy
environment:
YET_ANOTHER_CALENDAR_HOST: 0.0.0.0
YET_ANOTHER_CALENDAR_REDIS_HOST: yet_another_calendar-redis
YET_ANOTHER_CALENDAR_RELOAD: "True"

redis:
image: redis:latest
hostname: "yet_another_calendar-redis"
restart: always
environment:
ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: redis-cli ping
interval: 1s
timeout: 3s
retries: 50

frontend:
build:
context: ./frontend
container_name: calendar-frontend
restart: always
ports:
- 3000:80
- "3000:80"

0 comments on commit 924d771

Please sign in to comment.