Skip to content

Instantly share code, notes, and snippets.

@miguelpeixe
Last active November 7, 2017 17:23
Show Gist options
  • Save miguelpeixe/9a6e72709b77fea12c8a07f3b75b9af6 to your computer and use it in GitHub Desktop.
Save miguelpeixe/9a6e72709b77fea12c8a07f3b75b9af6 to your computer and use it in GitHub Desktop.
LIANE dev environment

Install docker

https://docs.docker.com/engine/installation/

Docker compose

Create a custom docker-compose file, example docker-compose.dev.yml, with the following:

version: '2'
services:
  app:
    build: .
    command: node watch.js
    links:
      - postgres
      - redis
    ports:
    - 3030:3030
    volumes:
    - /src/node_modules
    - .:/src
    environment:
      NODE_ENV: development
      NODE_CONFIG: |-
        {
          "url": "SITE_URL",
          "port": 3030,
          "public": "../public/",
          "paginate": {
            "default": 10,
            "max": 50
          },
          "postgres": "postgres://docker:docker@postgres:5432/liane",
          "redis": {
            "host": "redis"
          },
          "facebook": {
            "clientID": "[YOUR APP CLIENT ID HERE]",
            "clientSecret": "[YOUR APP SECRET HERE]",
            "admin": "[YOUR FACEBOOK USER PROFILE ID]",
            "adAccount": "[YOUR FACEBOOK AD ACCOUNT ID]"
          },
          "authentication": {
            "secret": "c0306988334bfd9c88629babd9f83cd4ce238d1c7f6d33b3a0d1cbde74d41b9de5e13eb8cd934a094a9d13f9509c1c22a8d4d2bceac926484cb60b2b5dba6e92015502edce4de5f1877bb1605b7a26a95223f620d78311ae0c2c5dbc1d4b2c988d77604e2015b1fd62e006b0c4ea57777ad2e9f43a99014d8404e58e917110817fabc34d958913d3ff2179d18e32192ad28a01244656d8a3d25081fca7ed86d7aad0f8d95455f28133ff62390298165c9b692ca04b23bfeb5f473b9ae47d722b54240335f1cdc7911dde325c188fa71458668a4b4817bfeabfbc2c61e85f5f889b2eacfc30b72e8271c1f4f7383e268efc5b3765fa8796b715a442d8aac2b8d5",
            "strategies": [
              "jwt",
              "local"
            ],
            "path": "/authentication",
            "service": "users",
            "jwt": {
              "header": {
                "type": "access"
              },
              "audience": "https://yourdomain.com",
              "subject": "anonymous",
              "issuer": "feathers",
              "algorithm": "HS256",
              "expiresIn": "1d"
            },
            "cookie": {
              "enabled": true,
              "name": "feathers-jwt",
              "httpOnly": false,
              "secure": false
            }
          }
        }
  postgres:
    image: postgres:alpine
    ports:
    - 15432:5432
    environment:
      POSTGRES_USER: 'docker'
      POSTGRES_PASSWORD: 'docker'
      POSTGRES_DB: 'liane'
  redis:
    image: redis:alpine

The PostgreSQL port will be publicly available as 15432

Start application

Start docker with the following command:

$ docker-compose -f docker-compose.dev.yml up

Update Facebook App information

Wait until the application builds and start running than copy the ngrok url to your facebook Login callback url.

Also use this URL to access the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment