Dockerfile to automate your Taiga deployment.
This project was initially forked from ipedrazas/taiga-docker
- Single docker container for taiga-front and taiga-back.
- Use your own webserver to power Taiga.
queeno/docker-taiga exposes port 8000 and exports the following volumes: /taiga-front-dist, /taiga-back/static, /taiga-back/media. You can use your own webserver (or existing reverse proxy!) to serve the frontend and/or proxy the API requests.
assets/nginx/taiga.conf contains a sample configuration for the nginx container. More information available at the bottom of this README.
assets/scripts/setup.sh
will deploy and run the postgres and taiga containers in one go.
-
Script parameters:
POSTGRES_DIR
indicates the host location where the postgres files will reside.API_NAME
indicates the taiga API server name or IP address. This should also include the relative TCP port (unless it's implied by the schema).API_SCHEMA
indicates whether the API requests will be made via HTTP or HTTPSYou can pass values via environment variables. If you do not, the following defaults will apply:
POSTGRES_DIR='/data/postgres' API_NAME='localhost:8000' API_SCHEMA='http'
If you want to manually deploy your docker container or to build your own image, please read this section.
-
Pull the latest image from Docker Hub
docker pull queeno/docker-taiga
-
or build your own image locally:
git clone https://github.com/queeno/docker-taiga.git cd docker-taiga docker build -t queeno/docker-taiga .
-
Run the postgres container:
docker run -d --name postgres -v ${POSTGRES_DIR}:/var/lib/postgresql/data postgres
-
Initialise the database:
docker exec postgres sh -c "su postgres --command 'createuser -d -r -s taiga'" docker exec postgres sh -c "su postgres --command 'createdb -O taiga taiga'"
-
Run taiga:
docker run -d -p 8000:8000 --env API_NAME="${API_NAME}" --name taiga --link postgres:postgres queeno/docker-taiga docker exec taiga bash -c "sed -i 's/API_NAME/${API_NAME}/g' /taiga-front-dist/dist/js/conf.json" docker exec taiga bash -c "sed -i 's/API_SCHEMA/${API_SCHEMA}/g' /taiga-front-dist/dist/js/conf.json"
-
Initalise the database:
docker exec taiga bash regenerate.sh
If you don't intend to deploy taiga behind a pre-existing webserver or reverse proxy, you can spin up an nginx docker container in one second:
docker run --volumes-from taiga --link taiga --name nginx -v "$(pwd)"/assets/nginx/taiga.conf:/etc/nginx/conf.d/default.conf:ro -p 80:80 -d nginx
- Generate a keypair on the host
openssl genrsa -out /tmp/taiga.pem 2048
- Generate a CSR
openssl req -new -key /tmp/taiga.pem -out /tmp/taiga.csr
- Send the csr to your CA for signing or self sign it:
openssl x509 -req -days 365 -in /tmp/taiga.csr -signkey /tmp/taiga.pem -out /tmp/taiga.crt
- Store the keypair in your host's keychain - for example on CentOS:
mv /tmp/taiga.pem /etc/pki/tls/private/
mv /tmp/taiga.crt /etc/pki/tls/certs/
- Run the nginx container:
docker run --volumes-from taiga --link taiga --name nginx -v /etc/pki/tls/certs/taiga.crt:/etc/ssl/cert.pem:ro -v /etc/pki/tls/private/taiga.key:/etc/ssl/cert.key:ro -v /opt/nginx/taiga_ssl.conf:/etc/nginx/conf.d/default.conf:ro -p 443:443 -d nginx