Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s3rgeym/url-shortener
Шаблон для разработки через Docker с возможностью отладки и автоматической перезагрузкой при изменении кода.
https://github.com/s3rgeym/url-shortener
asyncio docker docker-compose fastapi postgresql python vscode
Last synced: 1 day ago
JSON representation
Шаблон для разработки через Docker с возможностью отладки и автоматической перезагрузкой при изменении кода.
- Host: GitHub
- URL: https://github.com/s3rgeym/url-shortener
- Owner: s3rgeym
- Created: 2023-10-29T02:56:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-01T20:10:26.000Z (about 1 year ago)
- Last Synced: 2023-11-02T20:37:25.138Z (about 1 year ago)
- Topics: asyncio, docker, docker-compose, fastapi, postgresql, python, vscode
- Language: Python
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# URL Shortener
Real-world app example and template for development in Docker.
Development Stack: VSCode, Docker, Postgres, Pgadmin, Python, FastAPI, Asyncpg.
Launch compose:
```bash
docker compose up -d
```Then `F5` > `Python: Remote Attach` for Debugging. The application will start only after the debugger. This is a development template.
Code changes will take effect immediately.
Create SHORT URL via Curl:
```bash
$ curl -d'url=https://www.youtube.com/watch?v=capY9GLjVk8' localhost:8000
http://localhost:8000/5ZTmyEZZW0~HPJnfptY9f
```| URL | Service |
| --- | --- |
| | URL Shortener |
| | Documentation |
| | pgAdmin. Default credentials: `[email protected]:admin` |![image](https://user-images.githubusercontent.com/12753171/278887688-8d1a7627-5349-44a8-b314-4fbae730cf59.png)
![image](https://user-images.githubusercontent.com/12753171/278843106-a24e55bd-5c6f-4b60-b1b9-d188e7562d3c.png)Add new dependency:
```bash
# at host
poetry add whatever# rebuild service
docker compose up -d --build --force-recreate --no-deps url_shortener# or you can enter into container and add dependency
docker compose exec url_shortener sh
(inside container) poetry add whatever
```Follow logs:
```bash
docker compose logs -f url_shortener
```Stop:
```bash
docker compose down
```Delete all data:
```bash
docker compose down -v --rmi all
```Links:
*
*
*
*
*
*
*