Skip to content

Docker dev notes

phlax edited this page Apr 21, 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 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

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 backend

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

If you need to work with a different backend you can specify it explicitly

makey dev-postgres pootle migrate

To work with a particular backend by default, edit your .env file

POOTLE_DEV_IMAGE=dev-mariadb
Clone this wiki locally