You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
5.6 KiB

8 years ago
Taiga in Docker
===============
8 years ago
This container allows you to run [Taiga](https://taiga.io/) in a Docker container.
8 years ago
What is Taiga?
--------------
Taiga is a project management application that can handle both simple and
complex projects for startups, software developers, and other target teams.
It tracks the progress of a project. Taiga's design is clean and elegant
design—something that is supposed to be "beautiful to look at all day long."
With Taiga, you can use either Kanban or Scrum template, or both. Backlogs are
shown as a running list of all features and User Stories added to the project.
Taiga integrates video conferencing functions with the use of third party
services from Talky.io and Appear.in. Group and private chat is done via HipChat.
Dockerfile
----------
The Dockerfile performs the following steps:
* install the OS & Python dependencies required to run Taiga Django backend.
* install nginx - to serve the content including static assests which Django
app should not be handling.
* install circus - a process & socket manager for the Python web application.
* install gunicorn - a Python Web Server Gateway Interface (WSGI) HTTP Server
to serve dynamic content.
* create taiga user for running circus & gunicorn.
* clone stable branches of the taiga backend and frontend.
* copy templates which will be then processed by the launch script when the
container starts.
Running Taiga
=============
I recommend to use Docker Compose for running the Taiga.
Docker Compose
--------------
Below is a docker compose file as example
8 years ago
**docker-compose.yml**
8 years ago
```
version: '2'
volumes:
postgres_data: {}
taiga_static: {}
taiga_media: {}
networks:
backend: {}
services:
postgres:
# https://hub.docker.com/_/postgres/
image: postgres
networks:
- backend
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db:/docker-entrypoint-initdb.d:ro
env_file:
- ./postgres.env
- ./taiga-db.env
taiga:
# https://hub.docker.com/r/andrey01/taiga
image: andrey01/taiga
# build: .
networks:
- backend
ports:
- 80:80
volumes:
- taiga_static:/opt/taiga/static
- taiga_media:/opt/taiga/media
8 years ago
env_file:
- ./taiga.env
- ./taiga-db.env
environment:
- TZ=Europe/Amsterdam
depends_on:
- postgres
```
The following file is required so that Postgres will create taiga database that
is used by the Taiga backend.
8 years ago
**db/init-taiga-db.sh**
8 years ago
```
#!/bin/bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER $TAIGA_DB_USER;
CREATE DATABASE $TAIGA_DB_NAME;
GRANT ALL PRIVILEGES ON DATABASE $TAIGA_DB_NAME TO $TAIGA_DB_USER;
ALTER USER $TAIGA_DB_USER WITH PASSWORD '$TAIGA_DB_PASSWORD';
EOSQL
```
The environment variables
-------------------------
This file will defines a superuser for Postgres.
8 years ago
**postgres.env**
8 years ago
```
POSTGRES_USER=admin
POSTGRES_PASSWORD=admin
```
This file defines individual settings for Taiga.
8 years ago
**taiga.env**
8 years ago
```
GUNICORN_WORKERS=1
SITE_URI=http://taiga.mydomain.com
PUBLIC_REGISTER=true
ADMIN_EMAIL=admin@mydomain.com
NOREPLY_EMAIL=no-reply@mydomain.com
EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_PORT=587
EMAIL_USE_TLS=True
# EMAIL_HOST_USER=youremail@gmail.com
# EMAIL_HOST_PASSWORD=yourpassword
8 years ago
```
This file defines the database settings for Taiga.
8 years ago
**taiga-db.env**
8 years ago
```
TAIGA_DB_USER=taiga
TAIGA_DB_NAME=taiga
TAIGA_DB_PASSWORD=secretpassword
TAIGA_DB_HOST=postgres
TAIGA_DB_PORT=5432
```
8 years ago
8 years ago
Run the Taiga
8 years ago
-------------
8 years ago
```
docker-compose up -d taiga
```
Now you can access Taiga with your favorite Web Browser.
8 years ago
Default user **admin** with password **123123** will be created on the first
run. **Please do not forget to change the password.**
8 years ago
I recommend to run nginx reverse proxy in front of this container, so that
you could use TLS.
[Let's Encrypt](https://letsencrypt.org) project is now able to issue free
SSL/TLS certificates.
Maintenance
===========
8 years ago
Keeping your image up2dated
---------------------------
This is simple, just run the following commands which will ensure that you
are running the latest images
```
docker-compose pull
docker-compose up -d
```
8 years ago
Accessing the Taiga Database
----------------------------
You can access it using the docker compose or docker as follows
8 years ago
> docker-compose run --rm postgres sh -c 'PGPASSWORD=$TAIGA_DB_PASSWORD exec psql -h "$TAIGA_DB_HOST" -U $TAIGA_DB_USER'
8 years ago
8 years ago
> docker run -ti --rm --net taiga_backend --env-file taiga-db.env postgres sh -c 'PGPASSWORD=$TAIGA_DB_PASSWORD exec psql -h "$TAIGA_DB_HOST" -U $TAIGA_DB_USER'
8 years ago
Backup the database
-------------------
Below is an example of how you can make the Taiga PostgreSQL database backup
8 years ago
> docker-compose run --rm postgres sh -c 'PGPASSWORD=$TAIGA_DB_PASSWORD exec pg_dump -h "$TAIGA_DB_HOST" -U $TAIGA_DB_USER $TAIGA_DB_NAME' > taiga-db.backup
8 years ago
To restore it
8 years ago
> docker-compose run --rm postgres sh -c 'PGPASSWORD=$TAIGA_DB_PASSWORD exec psql -h "$TAIGA_DB_HOST" -U $TAIGA_DB_USER $TAIGA_DB_NAME' < taiga-db.backup
8 years ago
There are also volumes containing the data you might want to backup externally
```
$ docker volume ls
DRIVER VOLUME NAME
local taiga_taiga_media
local taiga_taiga_static
local taiga_postgres_data
```
Useful links
------------
* [Docker Compose file reference](https://docs.docker.com/compose/compose-file/)
* [Taiga: Setup production environment](https://taigaio.github.io/taiga-doc/dist/setup-production.html)
* [Read Taiga upgrade notes](https://taigaio.github.io/taiga-doc/dist/upgrades.html)
* [How to upgrade Taiga](https://taigaio.github.io/taiga-doc/dist/upgrades.html)