Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. version: '2'
  2.  
  3. services:
  4.  
  5. postgres:
  6. image: "postgres"
  7. ports:
  8. - "5433:5432"
  9. networks:
  10. - example
  11. environment:
  12. POSTGRES_DB: dbname
  13. POSTGRES_USER: admin
  14. POSTGRES_PASSWORD: admin1
  15. volumes:
  16. - database:/var/lib/postgresql/data
  17.  
  18. example.com:
  19. build: .
  20. ports:
  21. - "5000:5000"
  22. volumes:
  23. - .:/code
  24. networks:
  25. - example
  26. environment:
  27. DATABASE_URL: postgres://admin:admin1@postgres:5433/dbname
  28. NODE_ENV: local
  29. command: bash -c "sleep 10 && npm run knex migrate:latest"
  30. depends_on:
  31. - postgres
  32.  
  33. networks:
  34. curted:
  35. driver: bridge
  36.  
  37. volumes:
  38. database:
  39.  
  40. module.exports = {
  41. local: {
  42. client: 'pg',
  43. connection: process.env.DATABASE_URL,
  44. ssl: false,
  45. migrations: {
  46. tableName: 'knex_migrations'
  47. }
  48. },
  49. staging: {
  50. client: 'pg',
  51. connection: process.env.DATABASE_URL,
  52. ssl: true,
  53. migrations: {
  54. tableName: 'knex_migrations'
  55. },
  56. pool: {
  57. min: 1,
  58. max: 2
  59. }
  60. },
  61. production: {
  62. client: 'pg',
  63. connection: process.env.DATABASE_URL,
  64. ssl: true,
  65. migrations: {
  66. tableName: 'knex_migrations'
  67. },
  68. pool: {
  69. min: 1,
  70. max: 2
  71. }
  72. }
  73. };
  74.  
  75. curted.com_1 | > CuratedProducts@1.0.0 knex /home/app
  76. curted.com_1 | > knex "migrate:latest"
  77. curted.com_1 |
  78. curted.com_1 | Using environment: local
  79. curted.com_1 | Error: connect ECONNREFUSED 172.18.0.2:5433
  80. curted.com_1 | at Object.exports._errnoException (util.js:1022:11)
  81. curted.com_1 | at exports._exceptionWithHostPort (util.js:1045:20)
  82. curted.com_1 | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement