title: Running SailsJS through Docker Compose - Blank Screen
body: <p>Hoping someone can help me. I am trying to run my app through Docker.</p>
  
  <p>Dockerfile:</p>
  
  <pre><code>FROM node
  ENV NODE_ENV development
  WORKDIR /usr/app
  
  COPY package.json .
  RUN npm install --quiet
  
  COPY . .
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3'
  services:
    web:
      build: .
      command: node app.js --port=3000
      volumes:
        - .:/usr/app/
        - /usr/app/node_modules
      ports:
        - "3000:3000"
      depends_on:
        - postgres
    postgres:
      image: postgres:10.4-alpine
      environment:
        POSTGRES_USER: postgresql
        POSTGRES_DB: postgresql
  </code></pre>
  
  <p>When I run <code>docker-compose up</code>, the app is running fine and I can see Sails has been lifted. When visiting the url <a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a> I get a blank page, yet in the terminal, I see that the page has been viewed and a response sent. There are no error messages and I can see the Sails favicon in the browser.</p>
  
  <p>I am running native Docker in Windows 10 and I have PHP apps that run fine. As a side note, if I try to run sails-disk as my datastore, it has issues saving data to disk, not sure if that is related or not, but it could help.</p>
  
  <p>Edit: This is my package.json file in case it helps. I initially ran <code>sails new sails-app</code> and added postgresql and momentjs which means it's fairly standard.</p>
  
  <pre><code>{
    "name": "sails-app",
    "private": true,
    "version": "0.0.0",
    "description": "a Sails application",
    "keywords": [],
    "dependencies": {
      "@sailshq/connect-redis": "^3.2.1",
      "@sailshq/lodash": "^3.10.3",
      "@sailshq/socket.io-redis": "^5.2.0",
      "async": "2.0.1",
      "moment": "^2.22.1",
      "sails": "^1.0.1",
      "sails-hook-apianalytics": "^2.0.0",
      "sails-hook-organics": "^0.13.0",
      "sails-hook-orm": "^2.0.0-16",
      "sails-hook-sockets": "^1.4.0",
      "sails-postgresql": "^1.0.1"
    },
    "devDependencies": {
      "@sailshq/eslint": "^4.19.3",
      "@sailshq/htmlhint": "^0.9.16",
      "@sailshq/lesshint": "^4.6.6",
      "grunt": "1.0.1",
      "sails-hook-grunt": "^3.0.2"
    },
    "scripts": {
      "start": "NODE_ENV=production node app.js",
      "dev": "NODE_ENV=development node app.js",
      "test": "npm run lint &amp;&amp; npm run custom-tests &amp;&amp; echo 'Done.'",
      "lint": "eslint . --max-warnings=0 --report-unused-disable-directives &amp;&amp; echo '✔  Your .js files look so good.' &amp;&amp; htmlhint -c ./.htmlhintrc views/*.ejs &amp;&amp; htmlhint -c ./.htmlhintrc views/**/*.ejs &amp;&amp; htmlhint -c ./.htmlhintrc views/**/**/*.ejs &amp;&amp; htmlhint -c ./.htmlhintrc views/**/**/**/*.ejs &amp;&amp; htmlhint -c ./.htmlhintrc views/**/**/**/**/*.ejs &amp;&amp; htmlhint -c ./.htmlhintrc views/**/**/**/**/**/*.ejs &amp;&amp; htmlhint -c ./.htmlhintrc views/**/**/**/**/**/**/*.ejs &amp;&amp; echo '✔  So do your .ejs files.' &amp;&amp; lesshint assets/styles/ --max-warnings=0 &amp;&amp; echo '✔  Your .less files look good, too.'",
      "custom-tests": "echo \"(No other custom tests yet.)\" &amp;&amp; echo",
      "deploy": "echo 'This script assumes a dead-simple, opinionated setup on Heroku.' &amp;&amp; echo 'But, of course, you can deploy your app anywhere you like.' &amp;&amp; echo '(Node.js/Sails.js apps are supported on all modern hosting platforms.)' &amp;&amp; echo &amp;&amp; echo 'Warning: Specifically, this script assumes you are on the master branch, and that your app can be deployed simply by force-pushing on top of the *deploy* branch.  It will also temporarily use a local *predeploy* branch for preparing assets, that it will delete after it finishes.  Please make sure there is nothing you care about on either of these two branches!!!' &amp;&amp; echo '' &amp;&amp; echo '' &amp;&amp; echo 'Preparing to deploy...' &amp;&amp; echo '--' &amp;&amp; git status &amp;&amp; echo '' &amp;&amp; echo '--' &amp;&amp; echo 'I hope you are on the master branch and have everything committed/pulled/pushed and are completely up to date and stuff.' &amp;&amp; echo '********************************************'  &amp;&amp; echo '** IF NOT THEN PLEASE PRESS &lt;CTRL+C&gt; NOW! **' &amp;&amp; echo '********************************************' &amp;&amp; echo 'Press CTRL+C to cancel.' &amp;&amp; echo '(you have five seconds)' &amp;&amp; sleep 1 &amp;&amp; echo '...4' &amp;&amp; sleep 1 &amp;&amp; echo '...3' &amp;&amp; sleep 1 &amp;&amp; echo '...2' &amp;&amp; sleep 1 &amp;&amp; echo '...1' &amp;&amp; sleep 1  &amp;&amp; echo '' &amp;&amp; echo 'Alright, here we go.  No turning back now!' &amp;&amp; echo 'Trying to switch to master branch...' &amp;&amp; git checkout master &amp;&amp; echo &amp;&amp; echo 'OK.  Now wiping node_modules/ and running npm install...' &amp;&amp; rm -rf node_modules &amp;&amp; rm -rf package-lock.json &amp;&amp; npm install &amp;&amp; (git add package-lock.json &amp;&amp; git commit -am 'AUTOMATED COMMIT: Did fresh npm install before deploying, and it caused something relevant (probably the package-lock.json file) to change!  This commit tracks that change.' || true) &amp;&amp; echo 'Deploying as version:' &amp;&amp; npm version patch &amp;&amp; echo '' &amp;&amp; git push origin master &amp;&amp; git push --tags &amp;&amp; (git branch -D predeploy &gt; /dev/null 2&gt;&amp;1 || true) &amp;&amp; git checkout -b predeploy &amp;&amp; (echo 'Now building+minifying assets for production...' &amp;&amp; echo '(Hang tight, this could take a while.)' &amp;&amp; echo &amp;&amp; node node_modules/grunt/bin/grunt buildProd || (echo &amp;&amp; echo '------------------------------------------' &amp;&amp; echo 'IMPORTANT!  IMPORTANT!  IMPORTANT!' &amp;&amp; echo 'ERROR: Could not compile assets for production!' &amp;&amp; echo &amp;&amp; echo 'Attempting to recover automatically by stashing, ' &amp;&amp; echo 'switching back to the master branch, and then ' &amp;&amp; echo 'deleting the predeploy branch... ' &amp;&amp; echo &amp;&amp; echo 'After this, please fix the issues logged above' &amp;&amp; echo 'and push that up.  Then, try deploying again.' &amp;&amp; echo '------------------------------------------' &amp;&amp; echo &amp;&amp; echo 'Staging, deleting the predeploy branch, and switching back to master...' &amp;&amp; git stash &amp;&amp; git checkout master &amp;&amp; git branch -D predeploy &amp;&amp; false)) &amp;&amp; mv www .www &amp;&amp; git add .www &amp;&amp; node -e 'sailsrc = JSON.parse(require(\"fs\").readFileSync(\"./.sailsrc\", \"utf8\"));  if (sailsrc.paths&amp;&amp;sailsrc.paths.public !== undefined || sailsrc.hooks&amp;&amp;sailsrc.hooks.grunt !== undefined) { throw new Error(\"Cannot complete deployment script: .sailsrc file has conflicting contents!  Please throw away this midway-complete deployment, switch back to your original branch (master), remove the conflicting stuff from .sailsrc, then commit and push that up.\"); }  sailsrc.paths = sailsrc.paths || {};  sailsrc.paths.public = \"./.www\";   sailsrc.hooks = sailsrc.hooks || {};  sailsrc.hooks.grunt = false;  require(\"fs\").writeFileSync(\"./.sailsrc\", JSON.stringify(sailsrc))' &amp;&amp; git commit -am 'AUTOMATED COMMIT: Automatically bundling compiled assets as part of deploy, updating the EJS layout and .sailsrc file accordingly.' &amp;&amp; git push origin predeploy &amp;&amp; git checkout master &amp;&amp; git push origin +predeploy:deploy &amp;&amp; git push --tags &amp;&amp; git branch -D predeploy &amp;&amp; git push origin :predeploy &amp;&amp; echo '' &amp;&amp; echo '--' &amp;&amp; echo 'OK, done.  It should be live momentarily on your staging environment.' &amp;&amp; echo '(if you get impatient, check the Heroku dashboard for status)' &amp;&amp; echo &amp;&amp; echo 'Staging environment:' &amp;&amp; echo ' –•  https://staging.example.com' &amp;&amp; echo '       (hold ⌘ and click to open links in the terminal)' &amp;&amp; echo &amp;&amp; echo 'Please review that to make sure it looks good.' &amp;&amp; echo 'When you are ready to go to production, visit your pipeline on Heroku and press the PROMOTE TO PRODUCTION button.'"
    },
    "main": "app.js",
    "repository": {
      "type": "git",
      "url": "git://github.com/anonymous node/sails user/sails-app.git"
    },
    "author": "anonymous node/sails user",
    "license": "",
    "engines": {
      "node": "&gt;=10.0"
    }
  }
  </code></pre>