diff --git a/README.md b/README.md
index c4f8d767d2446836eb69bab1f476bc8497c014d8..3de5768f066255c91bd89fd406b238901738381d 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,8 @@
 
 ⚠️ [Git](https://git-scm.com/downloads), [Python](https://www.python.org/) and [Poetry](https://python-poetry.org/) must be installed and accessible ⚠️
 
+Poetry version must be greater or equal than 1.1.8. Otherwise it won't be able to install SQLAlchemy.
+
 ```bash
 python3 -m pip install fastapi_template
 python3 -m fastapi_template
diff --git a/fastapi_template/template/{{cookiecutter.project_name}}/deploy/Dockerfile b/fastapi_template/template/{{cookiecutter.project_name}}/deploy/Dockerfile
index b40f5eb9a07afcb897f3de5036b2724e917b1c35..7e052a8d4434ca12da97169984d5d322960e34ca 100644
--- a/fastapi_template/template/{{cookiecutter.project_name}}/deploy/Dockerfile
+++ b/fastapi_template/template/{{cookiecutter.project_name}}/deploy/Dockerfile
@@ -1,12 +1,16 @@
 FROM python:3.9.6-slim-buster
 
+RUN apt-get update && apt-get install -y \
+    wait-for-it \
+    && apt-get clean && rm -rf /var/lib/apt/lists/*
+
 RUN useradd -m {{cookiecutter.project_name}}
 
 USER {{cookiecutter.project_name}}
 
 ENV PATH="${PATH}:/home/{{cookiecutter.project_name}}/.poetry/bin:/home/{{cookiecutter.project_name}}/.local/bin"
 
-RUN pip install poetry==1.1.7
+RUN pip install poetry==1.1.8
 
 # Installing requirements
 RUN poetry config virtualenvs.create false
@@ -21,10 +25,7 @@ COPY . /home/{{cookiecutter.project_name}}/app/src/
 WORKDIR /home/{{cookiecutter.project_name}}/app/src/
 RUN pip install --use-feature=in-tree-build  .
 
-WORKDIR /home/{{cookiecutter.project_name}}/app
-
 USER root
-RUN rm -rf /home/{{cookiecutter.project_name}}/app/src
 RUN chown -R {{cookiecutter.project_name}} /home/{{cookiecutter.project_name}}
 RUN chmod -R 700 /home/{{cookiecutter.project_name}}
 USER {{cookiecutter.project_name}}
diff --git a/fastapi_template/template/{{cookiecutter.project_name}}/deploy/docker-compose.yml b/fastapi_template/template/{{cookiecutter.project_name}}/deploy/docker-compose.yml
index 3a0be7c52f9bc515bb3990bd85a255c8ee01dcd6..27a7ef0dd49e34749fcc2c22bbae26cbea979680 100644
--- a/fastapi_template/template/{{cookiecutter.project_name}}/deploy/docker-compose.yml
+++ b/fastapi_template/template/{{cookiecutter.project_name}}/deploy/docker-compose.yml
@@ -5,16 +5,11 @@ services:
     build:
       context: .
       dockerfile: ./deploy/Dockerfile
+    image: {{cookiecutter.project_name}}:latest
     env_file:
       - .env
     environment:
-      - {{cookiecutter.project_name | upper }}_VAR=test # stub
-      {%- if cookiecutter.db_info.name == "postgresql" %}
-      - {{cookiecutter.project_name | upper }}_DB_PORT=5432
-      {%- endif %}
-      {%- if cookiecutter.db_info.name == "mysql" %}
-      - {{cookiecutter.project_name | upper }}_DB_PORT=3306
-      {%- endif %}
+      - {{cookiecutter.project_name | upper }}_HOST=0.0.0.0
 
   {%- if cookiecutter.db_info.name == "postgresql" %}
   db:
@@ -24,6 +19,8 @@ services:
       - POSTGRES_PASSWORD={{cookiecutter.project_name}}
       - POSTGRES_USER={{cookiecutter.project_name}}
       - POSTGRES_DB={{cookiecutter.project_name}}
+    volumes:
+      - {{cookiecutter.project_name}}-db-data:/var/lib/postgresql/data
   {%- endif %}
 
   {%- if cookiecutter.db_info.name == "mysql" %}
@@ -34,6 +31,17 @@ services:
       - MYSQL_PASSWORD={{cookiecutter.project_name}}
       - MYSQL_USER={{cookiecutter.project_name}}
       - MYSQL_DATABASE={{cookiecutter.project_name}}
+    volumes:
+      - {{cookiecutter.project_name}}-db-data:/bitnami/mysql/data
+  {%- endif %}
+
+  {% if cookiecutter.db_info.name != 'none' %}
+  migrator:
+    build:
+      context: .
+      dockerfile: ./deploy/Dockerfile
+    image: {{cookiecutter.project_name}}:latest
+    command: wait-for-it {{cookiecutter.project_name}}-db:{{cookiecutter.db_info.port}} -- alembic upgrade head
   {%- endif %}
 
   {%- if cookiecutter.enable_redis == "True" %}
@@ -43,3 +51,9 @@ services:
     environment:
       - ALLOW_EMPTY_PASSWORD=yes
   {%- endif %}
+
+{% if cookiecutter.db_info.name != 'none' %}
+volumes:
+  {{cookiecutter.project_name}}-db-data:
+    name: {{cookiecutter.project_name}}-db-data
+{% endif %}
diff --git a/fastapi_template/template/{{cookiecutter.project_name}}/pyproject.toml b/fastapi_template/template/{{cookiecutter.project_name}}/pyproject.toml
index b93dc404925db51f547fc3632c22b0e311221289..7df58b4ef5fb07d991025b48804b1f4b0b4097e6 100644
--- a/fastapi_template/template/{{cookiecutter.project_name}}/pyproject.toml
+++ b/fastapi_template/template/{{cookiecutter.project_name}}/pyproject.toml
@@ -17,8 +17,7 @@ uvicorn = "^0.15.0"
 pydantic = {version = "^1.8.2", extras = ["dotenv"]}
 yarl = "^1.6.3"
 {%- if cookiecutter.db_info.name != "none" %}
-SQLAlchemy = {version = ">=1.4,<1.4.23", extras = ["mypy"]}
-greenlet = "^1.1.1"
+SQLAlchemy = {version = "^1.4", extras = ["mypy", "asyncio"]}
 {%- endif %}
 {% if cookiecutter.enable_alembic == "True" %}
 alembic = "^1.6.5"
@@ -49,6 +48,9 @@ black = "^21.7b0"
 pytest-async-sqlalchemy = "^0.1.3"
 {%- endif %}
 autoflake = "^1.4"
+{%- if cookiecutter.db_info.name != "none" %}
+SQLAlchemy = {version = "^1.4", extras = ["mypy"]}
+{%- endif %}
 {%- if cookiecutter.enable_alembic %}
 pytest-alembic = "^0.3.3"
 {%- endif %}
diff --git a/fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/web/lifetime.py b/fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/web/lifetime.py
index 15a4ea83e025588b22cd11af3f8c985600f61e21..56a383a5ddf254534b286d1dfcf5ee9bfab9bbe1 100644
--- a/fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/web/lifetime.py
+++ b/fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/web/lifetime.py
@@ -10,7 +10,7 @@ import aioredis
 
 {%- if cookiecutter.db_info.name != "none" %}
 from asyncio import current_task
-from sqlalchemy.ext.asyncio import (  # type: ignore
+from sqlalchemy.ext.asyncio import (
     AsyncSession,
     async_scoped_session,
     create_async_engine,
diff --git a/pyproject.toml b/pyproject.toml
index 34ffd917d9dd09d69e796d8956a98527251a6114..7904b9b86a6360412e8f161a51be9baf484b9aa6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "fastapi_template"
-version = "2.1.1"
+version = "2.1.2"
 description = "Feature-rich robust FastAPI template"
 authors = ["Pavel Kirilin <win10@list.ru>"]
 packages = [