Skip to content

Commit bf3da17

Browse files
committed
Updated fastapi and package versions
1 parent 8ea7efd commit bf3da17

File tree

59 files changed

+215
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+215
-260
lines changed

app/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
__pycache__
2-
.DS_Store
2+
.DS_Store
3+
.venv

app/__pycache__/main.cpython-39.pyc

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

app/core/configs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import os
2-
import secrets
1+
from functools import lru_cache
32
from typing import List
3+
44
from pydantic import BaseSettings, validator
5-
from functools import lru_cache
65

76

87
class Settings(BaseSettings):
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

app/poetry.lock

Lines changed: 176 additions & 233 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/pyproject.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ description = "FastAPI Boilerplate"
55
authors = ["Shohidul <theshohidul@gmail.com>"]
66

77
[tool.poetry.dependencies]
8-
python = "^3.9"
9-
uvicorn = {version = "0.17.6", extras = ["standard"]}
10-
fastapi = {version = "0.80.0", extras = ["all"]}
11-
json-log-formatter = "0.4.0"
12-
SQLAlchemy = "^1.4.40"
13-
alembic = "^1.8.1"
14-
databases = {extras = ["aiomysql"], version = "^0.6.1"}
8+
python = "^3.11"
9+
uvicorn = {extras = ["standard"], version = "^0.20.0"}
10+
fastapi = {extras = ["all"], version = "^0.89.1"}
11+
json-log-formatter = "^0.5.1"
12+
alembic = "^1.9.2"
13+
databases = {extras = ["aiomysql"], version = "^0.7.0"}
1514
loguru = "^0.6.0"
1615
cryptography = "^38.0.1"
1716
bcrypt = "^4.0.0"
18-
PyJWT = "^2.5.0"
17+
sqlalchemy = "^1.4.46"
18+
pyjwt = "^2.6.0"
19+
mysqlclient = "^2.1.1"
1920

2021
[tool.poetry.dev-dependencies]
2122

docker/.DS_Store

0 Bytes
Binary file not shown.

docker/conf/python/Dockerfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
FROM python:3.9
1+
FROM python:3.11
22

3-
ENV POETRY_VERSION=1.1.15 \
3+
ENV POETRY_VERSION=1.2.2 \
4+
POETRY_HOME=/etc/poetry \
45
ENV=dev
56

7+
ENV PYTHONUNBUFFERED=1 \
8+
PYTHONDONTWRITEBYTECODE=1
9+
610
# Install and setup poetry
7-
RUN pip install -U pip \
11+
RUN apt-get update \
12+
&& apt install -y python3-dev default-libmysqlclient-dev build-essential \
13+
&& pip install -U pip \
814
&& pip install mysqlclient \
915
&& apt-get update \
10-
&& apt install -y curl netcat \
11-
&& curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - --version $POETRY_VERSION
16+
&& apt install -y curl \
17+
&& curl -sSL https://install.python-poetry.org | POETRY_HOME=$POETRY_HOME python3 - --version $POETRY_VERSION
1218

13-
ENV PATH="${PATH}:/root/.poetry/bin"
1419

15-
WORKDIR /app
20+
ENV PATH="${PATH}:$POETRY_HOME/bin"
1621

17-
COPY pyproject.toml poetry.lock* /app/
22+
WORKDIR /app__pycache__
1823

19-
RUN poetry config virtualenvs.create false \
20-
&& poetry install
24+
COPY pyproject.toml poetry.lock* /app/

docker/docker-compose.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ services:
1212
- "8080:8080"
1313
volumes:
1414
- ./../app:/app:rw
15-
command: sh -c "
16-
chmod +x ./wait-for-it.sh
15+
command: sh -c "cd /app && poetry config virtualenvs.in-project true && poetry install
16+
&& chmod +x ./wait-for-it.sh
1717
&& ./wait-for-it.sh -t 0 mysql:3306
18-
&& uvicorn main:app --reload --host 0.0.0.0 --port 8080
19-
"
18+
&& /app/.venv/bin/uvicorn main:app --reload --host 0.0.0.0 --port 8080"
2019
depends_on:
2120
- mysql
21+
networks:
22+
- fastapi_app_network
2223

2324
mysql:
2425
platform: linux/x86_64
@@ -33,4 +34,10 @@ services:
3334
ports:
3435
- 3307:3306
3536
volumes:
36-
- ./data/mysql:/var/lib/mysql
37+
- ./data/mysql:/var/lib/mysql
38+
networks:
39+
- fastapi_app_network
40+
41+
networks:
42+
fastapi_app_network:
43+
driver: bridge

0 commit comments

Comments
 (0)