Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

DESQOL/GlutenServer

Repository files navigation

GlutenServer

Travis (.com) branch Coveralls github branch Greenkeeper badge

Links

  • Swagger UI

    Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

  • Portainer

    Portainer is a lightweight management UI which allows you to easily manage your Docker host or Swarm cluster.

Setup

Filename: docker-compose.override.yml

version: '3.7' # Must match the version specified in docker-compose.yml

services:
  nginx:
    build: # This results in using the development stage which disables HTTPS
      target: development

  gateway-cache:
    ports: # Allow access to the gateway-cache, usefull for debugging in development
        - 6379:6379

  gateway-database:
    ports: # Allow access to the gateway-database, usefull for debugging in development
      - 3306:3306

  gateway-service:
    environment: # Set NODE_ENV to development to output all logs to the Docker console
      NODE_ENV: development

TypeORM

All commands, for TypeORM, are written for usage in a development enviremont, to use these commands in production prefix them with the following:

$ docker-compose exec gateway-service ...

Generate migration

$ npm run typeorm -- migration:generate -n PostRefactoring

Apply migration

$ npm run typeorm -- migration:run

Undo migration

$ npm run typeorm -- migration:revert

Docker

Build

$ docker-compose build

Run

$ docker-compose up

Build & Run (production)

$ docker-compose up --build

Scale a service (production)

$ docker-compose up --scale gateway-service=X

Build & Run (development)

$ docker-compose up --detach --build gateway-database gateway-cache
$ cd server; npm run dev

Updated local MySQL init file

$ docker-compose exec -T gateway-database mysqldump -uroot -proot --no-data --skip-comments --databases gluten > gateway/database/init.sql
$ docker-compose exec -T gateway-database mysqldump -uroot -proot --no-create-info --skip-comments gluten migrations >> gateway/database/init.sql

Updated local MySQL test file

$ docker-compose exec -T gateway-database mysqldump -uroot -proot --no-create-info --skip-comments gluten --ignore-table=gluten.migrations > gateway/database/test.sql