Skip to content

Everything Docker

Antoine Phan edited this page Aug 20, 2025 · 5 revisions

Services

UMIL has 4 main services:

service container name functionalities
app vim-app Django app that serves as both frontend and backend. In dev mode, vite runs at port 5173 to serve TypeScript files, and sass that hot-reload SASS files
solr vim-solr UMIL's search engine that provides full-text search, faceted search, indexing, etc.
db vim-db PostgreSQL database
nginx vim-nginx Reverse proxy for vim-app and serve static files

UMIL Networking

  • All services in UMIL are internally connected.
  • nginx is the only service with port 8000 exposed to the host machine, which connects to the container's port 80. (0.0.0.0:8000->80/tcp)
  • Exception for dev mode: port 5173 is exposed for app, allowing external communication between its two services: vite (port 5173) and django. These two internal services works via django-vite under the hood.

UMIL web-app

Dockerfile

  • Image build order for MODE=dev: builder -> dev
  • Image build order for MODE=prod: builder, prod-frontend -> prod

Common base steps (builder stage image)

  • Install poetry using pip
  • Use poetry to insstall dependencies, without dev and debug
  • Copy files web-app and frontend files to the container
  • Set environment variable PYTHONPATH and PATH

For development ($MODE=dev)

  • Install debug dependencies that was missing from the builder stage
  • Serve simultaneously the frontend (vite dev server, port 5173) and Django development server

For production ($MODE=prod)

  • Build frontend files with vite and sass
  • Move the frontend build to Django assets
  • Serve the app with Gunicorn

Clone this wiki locally