Skip to content

InternetKungen/shitchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShitChat

A docker-compose - Based on Chat_API + http-chat + local mongodb

Info

This App is made for training and is not secure. Usually the docker containers are connected through its own network, but I couldn't get it to work for me, so this version is connected with external ports, which can all be public. The shitchat-client is the only container with a port exposed, and is connected to the other containers (shitchat-api and shitchat-mongodb) though a docker-network.

Installation

Download:

git clone <source>.git

GOTO DIR:

cd shitchat

Edit sources

/shitchat/docker-compose.yml

MongoDB Settings:

    mongodb:
        #ports:
        #    - "27017:27017"
        environment:
            - MONGO_INITDB_ROOT_USERNAME=mongodb_admin_username
            - MONGO_INITDB_ROOT_PASSWORD=mongodb_admin_password

Chat API settings:

DB_HOST - is the mongodb-server

    api:
        #ports:
        #    - "3000:3000"
        environment:
            - PORT=3000
            - DB_USERNAME=mongodb_admin_username
            - DB_PASSWORD=mongodb_admin_password
            - DB_NAME=shitchat
            - DB_HOST=mongodb:27017

Client settings:

EXTERNAL_API_URI - is the api-server

    client:
        ports:
            - "4000:4000"
        environment:
            - PORT=4000
            - EXTERNAL_API_URI=http://api:3000

Create .env-files

/shitchat/api/.env

PORT=3000
DB_USERNAME=mongodb_admin_username
DB_PASSWORD=mongodb_admin_password
DB_NAME=shitchat
DB_HOST=mongodb:27017

/shitchat/client/.env

PORT=4000
EXTERNAL_API_URI=http://api:3000

Create these files

/shitchat/api/src/config/config.js

import dotenv from 'dotenv';

dotenv.config();

  export const dbDetails = {
    username: process.env.DB_USERNAME,
    password: process.env.DB_PASSWORD,
    host: process.env.DB_HOST,
    database: process.env.DB_NAME
  };

/shitchat/api/src/config/secret.txt

write a secret word or sentence used for encryption in this file

Install with docker

Install docker and then run app.

sudo docker-compose up --build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published