Comments (6)
Thank you for your issue, and congratulations on being the first one to actually open an issue on the repository (apart from me, of course). There is indeed an issue I can reproduce, locally.
You can fix it by editing your .env
file, updating DJANGO_SETTINGS_MODULE=config.settings.production
to DJANGO_SETTINGS_MODULE=config.settings.local
.
I'll push a fix to the documentation so other people don't hit face the same issue.
I´d really like to see trax more modular and better documented to integrate it into our running Mattermost instance.
I'm not sure what you mean by more modular, but I can sure help with the documentation. It would be really great if you could open a dedicated issue, pointing to unclear / not good enough parts of the documentation, I'd be more than happy to work on that.
I´m not very familiar with Docker and have no idea what went wrong.
Docker is used as the privileged deployment method because it should make things simpler. Trax requires five services to work properly:
- A database (PostgreSQL)
- A web server (Nginx)
- An application server (Django / WSGI)
- A cache server (Redis)
- (optional) A task process to run recurring tasks, such as sending reminders, or stopping too old timers.
While you could deploy this by yourself and make the whole thing work, it would require a lot of plumbery and knowledge of how the underlying systems works (how to configure a database, a redis servir, a Nginx server, etc.).
The idea is to avoid that by using Docker, which will spawn and configure each service automatically, running them into isolated containers, thanks to the docker-compose.yml file. It also offer additional security out of the box, since containers are isolated and not reachable publicly. For example, the PostgreSQL server, running in a container will only be accessible by the application server container, meaning you don't have to configure your firewall to block access to it from external world.
from trax.
You can see a special mention in the documentation regarding the whole .env
file setup.
from trax.
Hi @EliotBerriot,
first of all thanks for your explanations, I will try my luck again if I find some time the next days.
As for users, who already have a productive Mattermost environment, most of the mentioned components are already there. As for our environment we´ve got
- A database (PostgreSQL)
- A web server (Nginx) with SSL certs
- An application server (Django / WSGI)
- A cache server (Redis)
- A task process to run recurring tasks, such as sending reminders, or stopping too old timers.
So I don´t want to setup another VM running Docker and serving a complete Mattermost ecosystem just for the benefit of an easy deployment of the few missing parts.
Nevertheless: Thanks for this great integration!
Regards,
Markus
from trax.
Please note that mattermost is provided in the development docker-compose file, so you can test your code changes locally directly in a fully working mattermost instance (in case you don't have another accessible mattermost instance).
However, in production, we assume you already have a separate, working mattermost instance, as shown in the deployment documentation.
When you want to try trax locally, you usally want to spend the less time possible on configuration, this is why the dev.yml
docker-compose file is provided.
Now, regarding deployment, the good new is you can totally reuse your Postgres instance to store trax data. You just need to provide a DATABASE_URL
variable in the .env file, such as DATABASE_URL=psql://user:password@yourdatabaseip/database
. I have to admit it is not documented, but it is possible.
You can also use your existing nginx server, using a proxy_pass
directive pointing to the trax container.
To get rid of the services you don't want in production, just edit the example docker-compose.yml file, removing any service you don't want to keep (such as postgres and nginx):
version: '2'
services:
django: &django_base
build:
context: .
dockerfile: ./compose/django/Dockerfile
user: django
depends_on:
- redis
command: /gunicorn.sh
env_file: .env
ports:
# Here you can provide another port for your host machine to bind the container port on.
# For example, set 8001:5000 to have your trax instance accessible locally on port 8001
# You can then configure your own nginx to proxy pass to 127.0.0.1:8001
- 7087:5000
worker:
<<: *django_base
command: python manage.py trax_schedule
redis:
image: redis:latest
This way, you keep only the services you want, while keeping the flexibility of using docker for the trax-related containers. If you really don't want to use Docker, even for trax processes and redis, you can install and launch them by yourself, but it will require more configuration. You can start by looking at compose/django/Dockerfile
to see what should be installed and how.
from trax.
Hi @EliotBerriot, this seems to be a good approach, I only had a problem with redundant services. Using Docker for hosting Trax and it´s direct dependencies is totally okay for me. Thanks a lot again!
from trax.
Sure, keep me informed if you face any issue :)
from trax.
Related Issues (20)
- Allow users to setup reminders
- Make the timezone configurable globally and per user HOT 1
- Store token in database
- Retroactive /trax stop hh:mm stops in the future HOT 1
- Automatically close running timers at midnight
- configure dateparser to prefer future dates HOT 1
- Upgrade to latest mattermost in dev, so we can setup webhooks and everything automatically
- Add teams / projects
- Make mattermost/slack integration less coupled, more modular
- Mattermost moving to API version 4 HOT 3
- Fix timezone errors
- Install without docker HOT 3
- After login I got: CSRF verification failed. Request aborted. HOT 6
- Trax/django produces HTTP 500 internal server errors HOT 15
- Problems during building worker with PostgreSQL 11.5 HOT 4
- Invalid HTTP_HOST header: '127.0.0.1'. You may need to add '127.0.0.1' to ALLOWED_HOSTS. HOT 2
- Better help (for commands)
- Allow to stop in the past
- Allow to list from past
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trax.