Skip to content

Docker dev notes

Allan Nordhøy edited this page Apr 23, 2018 · 11 revisions

(WORK IN PROGRESS)

Setup a docker environment

Following the guide at https://github.com/translate/pootle/wiki/Docker-setup-notes

The development images contain the dependencies for the latest master, but do not contain an installation of Pootle itself.

When you start a development service it binds your repo from the host filesystem to the container, updating any dependencies as per required inside the container.

As your filesystem is "live" you can edit and enjoy the benefits of Django's automatic reloading as you work.

Pull the required images

(host) makey pull dev

Migrate the and initialize the database

The --no-projects flag is optional

(host) makey dev pootle migrate
(host) makey dev pootle initdb --no-projects

Create and a verify a superuser

assuming you create a user with username of "pootleadmin"

(host) makey dev pootle createsuperuser
(host) makey dev pootle verify_user pootleadmin

Start a development server

This will start a development server on 0.0.0.0:8000

makey dev

If you are on the same machine you should now be able to access the server on http://localhost:8000

Customize Pootle (Django) settings

If you have a file dev.conf in the root of your repository it will use the settings from that.

Using a different database back-end

By default the development service use SQLite, as this is fast for dev testing.

If you need to work with a different back-end you can specify it explicitly

makey dev-postgres pootle migrate

To work with a particular back-end by default, edit your .env file

POOTLE_DEV_IMAGE=dev-mariadb

Then you can can pull and run the dev service

(host) makey pull dev
(host) makey dev shell
(app) pootle@99aa7c419a21:/app/src/pootle$ echo $APP_DB_ENV    
postgres
Clone this wiki locally