Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. 2017-07-11T12:13:03.823882+00:00 app[web.1]: connection = Database.connect(**conn_params)
  2. 2017-07-11T12:13:03.823882+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
  3. 2017-07-11T12:13:03.823883+00:00 app[web.1]: conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
  4. 2017-07-11T12:13:03.823884+00:00 app[web.1]: django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known
  5.  
  6. web: sh -c 'cd PROJECT/backend/project && gunicorn project.wsgi --log-file -'
  7.  
  8. DockerProject
  9. ├── Dockerfile
  10. ├── Procfile
  11. ├── init.sql
  12. ├── requirements.txt
  13. ├── docker-compose.yml
  14. └── PROJECT
  15. ├── frontend
  16. └── backend
  17. └── project
  18. ├── prices
  19. ├── manage.py
  20. └── project
  21. └── all project files
  22.  
  23. # Create image based on the official Node 6 image from dockerhub
  24. FROM node:6
  25.  
  26. # Create a directory where our app will be placed
  27. RUN mkdir -p /usr/src/app
  28.  
  29. # Change directory so that our commands run inside this new directory
  30. WORKDIR /usr/src/app
  31.  
  32. # Copy dependency definitions
  33. COPY package.json /usr/src/app
  34.  
  35. # Install dependecies
  36. RUN npm install
  37.  
  38. # Get all the code needed to run the app
  39. COPY . /usr/src/app
  40.  
  41. # Expose the port the app runs in
  42. EXPOSE 4200
  43.  
  44. # Serve the app
  45. CMD ["npm", "start"]
  46.  
  47. FROM python:3.6.1
  48. ENV PYTHONUNBUFFERED 1
  49. RUN mkdir /code
  50. WORKDIR /code
  51. ADD requirements.txt /code/
  52. RUN pip3 install -r requirements.txt
  53. ADD . /code/
  54.  
  55. version: '3'
  56.  
  57. services:
  58. db:
  59. image: postgres
  60. environment:
  61. POSTGRES_USER: aso
  62. POSTGRES_PASSWORD: somepass
  63. django:
  64. build: .
  65. command: python3 MainDirectory/backend/myProject/manage.py runserver 0.0.0.0:8001
  66. volumes:
  67. - .:/code
  68. ports:
  69. - "8001:8001"
  70. depends_on:
  71. - db
  72. angular:
  73. build: MainDirectory/frontend
  74. ports:
  75. - "4200:4200"
  76. depends_on:
  77. - django
  78.  
  79. CREATE USER myUser;
  80. CREATE DATABASE myProject;
  81. GRANT ALL PRIVILEGES ON DATABASE myProject TO myUser;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement