This is a bootstrap setup for a single service (webapp). The service is shipped as Docker image. The service will provide a Django/DRF webapp, which displays the tables within the given DB.
Includes:
- Task.
- Poetry.
- DB drivers: ODBC and PostgreSQL.
- Non-root user.
- Caches.
Current image size: ~230 MB
❯ docker images | grep example-django-mssql-docker-webapp
example-django-mssql-docker-webapp latest a071208f4698 31 seconds ago 229MBThe service utilizes a given MS SQL.
Unfortunately MS SQL does not respect URLs, so you have to configure each aspect
of credentials explicitly. See .env.sample for examples. WEBAPP_ is a prefix for env vars.
After successful build & run, you can open http://localhost:8000/ and observe list of tables in your MS SQL database.
Before doing something, make sure that you have
- copied
.env.sampleto.env - modified values in
.envaccording to your realm
First, hit docker compose build.
Next, hit task docker-up OR docker compose up -d.
If you have brew, pyenv and Task installed, this would be enough:
task setup-toolchain
First, be sure you're installed Microsoft ODBC drivers. Here are some key points.
Next, if you have pyenv and Task installed, this might be enough:
task setup-toolchain
I haven't checked yet this way, please send me a feedback in case of any bug.
- be sure you have Microsoft ODBC drivers installed. Here are some key points.
- install Python 3.11.3
- install Poetry 1.5.1
- bind Python 3.11.3 to the cloned directory (this project)
- create venv and install dependencies:
poetry install --with dev --sync - double-check your
.env - start webapp with
poetry run python manage.py runserver 0.0.0.0:8000