Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Getting Started

Tim Buchholz edited this page Feb 21, 2021 · 14 revisions

Setup with docker

  1. Clone the repo git clone https://github.com/BuchholzTim/Whitebird.git.
  2. Navigate to the docker folder in the project. There are two folders whitebird_dev and whitebird_prod. For production we only need the whitebird_prod.
  3. In the whitebird_prod folder you can find a docker-compose.yml and a config file backend.env.
  4. Configure all files to your needs or just use the default settings.
  5. To start the application just use docker-compose up -d to run the application.
  6. After successful building go to http://localhost:40000 (with default settings) and start collaborating!

Config-Files

docker-compose.yml

services:
  mongodb:
    container_name: WhitebirdDatabase  # Name of the database container
    restart: 'no'
    image: mongo:latest
    environment:
      MONGO_INITDB_ROOT_USERNAME: root  # Root Username MongoDB 
      MONGO_INITDB_ROOT_PASSWORD: asdasd  # Password of the MongoDB
    volumes:
      - mongodb_data:/data/db
  backend:
    container_name: WhitebirdBackend  # Name of the backend container
    restart: 'no'
    build: ../../backend
    env_file: ./backend.env
    depends_on:
      - mongodb
    ports:
      - '40001:3001' # Backend Port API
  frontend:
    container_name: WhitebirdFrontend
    restart: 'no'
    build: ../../frontend
    ports:
      - '40000:5000' # Frontend Port

volumes:
  mongodb_data:

Frontend-Config

The Frontend (currently) has to be configured by changing the following three environment-variables in the Dockerfile of the frontend.

Nuxt needs those Values at Build-Time and doesn't recognize them, when they are set via a frontend.env in the docker-compose.yml.

# Backend Server Location
API_URL='http://backend:3001/'  # the ip and the port of api of our backend
SOCKET_URL='http://backend:3002/'  # the ip and the port of the socket in our backend

# Frontend Host
FRONTEND_HOST='http://localhost:40000'  # the ip and the port needed for for the link shown to share a whiteboard

backend.env

# ---------------------- MONGODB ----------------------------
MONGO_URI=mongodb://root:asdasd@mongodb # the db connection string
MONGO_DBNAME=backend # the name of our mongodb

# -------------------- APP SETTINGS -------------------------
APP_BACKEND_PORT=3001 # the port of our backend
APP_SOCKET_PORT= # the port of our socket - If you want the Socket to run on the same Port (which is required by some providers like Heroku), just leave this empty>
APP_JOINCODE_LENGTH=8 # the length of the join-codes