Skip to content

tinbox/tinbox-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

tinbox-docker

Docker orchestration for tinbox.

Overview

A work-in-progress overview of tinbox services and docker containers.

                             ╭───────────────╮
                             │     nginx     │
                             ╞═══════════════╡
                             │      app      ├───────────┐
                             ╰───────┬───────╯           │
                                     │                   │
         ╭───────────────╮   ╭───────┴───────╮   ╭───────┴───────╮
(IMAP)   │      mx       ├───┤      api      │   │     socker    │
         ╰───────────────╯   ╰──┬─────────┬──╯   ╰────────────┬──╯
                                │         │                   │
                   ╭────────────┴──╮   ╭──┴────────────╮   ╭──┴────────────╮   ╭───────────────╮
                   │    postgres   │   │ elasticsearch │   │     redis     │   │   rabbitmq    │
                   ╰───────────────╯   ╰───────────────╯   ╰───────────────╯   ╰───────────────╯

         ╭───────────────╮
         │    www_data   │
         ╰───────────────╯

Setup

Build tinbox docker image:

cd <tinbox repo>
# --force-rm not required but handy if something goes wrong
docker build --force-rm -t tinbox_api .

Build tinbox-mx docker image:

cd <tinbox-mx repo>
docker build --force-rm -t tinbox_mx .

Build tinbox-app docker image:

cd <tinbox-app repo>
docker build --force-rm -t tinbox_app .

Build remaining images (nginx, db, etc.):

cd <tinbox-docker repo>/tinbox
docker-compose build
mkdir -p /var/lib/docker/volumes/tinbox

Migrate database and collect static assets

docker-compose run --rm api migrate --noinput
docker-compose run --rm api collectstatic --noinput

Run

Start everything:

docker-compose up -d

Develop

For most cases an image can just be rebuild via compose.

docker-compose up -d api

This will rebuild/restart the api service along with dependent services, if needed. Pass --force-recreate to force the image to be re-created.

Misc handy commands

Rebuild (only) nginx container to get new app container data:

docker-compose up --force-recreate --no-deps -d nginx

Remove dangling images:

docker rmi $(docker images --quiet --filter "dangling=true")

Releases

No releases published

Packages

No packages published