Application de chat Node.js utilisant Express, Socket.io, Redis et Mithril.
Voir FLARUM Documentation: http://flarum.org/docs/api/
| Variable | Description | Taper | Valeur par défaut |
|---|---|---|---|
| Env | Environnement | facultatif | développement |
| PORT | Application portuaire | facultatif | 5000 |
| Flarum_api_endpoint | URL de l'API | requis | aucun |
| Cookies_secret | Définir le secret des cookies aléatoires | requis | aucun |
| Session_Secret | Définir le secret de session aléatoire | requis | aucun |
| Redis_url | Reded instance ip / hostname | requis | aucun |
| Piwik_id | ID piwik | facultatif | aucun |
| Piwik_url | URL piwik | facultatif | aucun |
Clone le projet et installez les dépendances:
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
yarn global add bower gulp pm2
yarn install
gulpCréer un fichier .env dans Root de projet avec ce contenu:
ENV=production
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
Démarrer l'application:
pm2 start --node-args= " --harmony " --name mondedie-chat app.jsApplication ouverte: http://127.0.0.1:5000/
Clone le projet et installez les dépendances:
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
yarn global add -g bower gulp nodemon
yarn install
gulpCréer un fichier .env dans Root de projet avec ce contenu:
ENV=development
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
Créez un fichier ProCFile_dev dans Root du projet avec ce contenu:
web: nodemon --delay 1 --exec "node --harmony" app.js
worker: gulp watch
Démarrer l'application:
foreman start -f Procfile_devApplication ouverte: http://127.0.0.1:5000/
docker pull mondedie/mondedie-chatDéfinir les variables d'environnement dans docker-compose.yml
Nous avons créé un docker-compose.yml comprenant 3 conteneurs:
Créez un nouveau Nginx Vhost avec ce contenu:
# /mnt/docker/nginx/sites-enabled/chat.conf
server {
listen 8000 ;
server_name chat.domain.tld;
location / {
proxy_pass http://chat:5000;
# For websockets handshake to establish the upgraded connection
proxy_http_version 1.1 ;
proxy_set_header Upgrade $http_upgrade ;
proxy_set_header Connection "upgrade" ;
}
}Courir !
docker-compose up -dsudo echo ' 127.0.0.1 mondedie-chat.dev ' >> /etc/hosts
echo ' export FLARUM_API_ENDPOINT="http://your-domain.tld/api/" ' >> ~ /.bash_profile cd /path/to/chat/mondedie-chat
npm install
docker-compose --file dev.yml up -d
gulp watchApplication ouverte: http://mondedie-chat.dev:5000/
https://github.com/mondefiefr/mondedie-chat/issues
Licence Apache version 2.0