Guest User

Untitled

a guest
Jul 12th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. version: '2'
  2. services:
  3. db:
  4. image: postgres
  5. ports:
  6. - 5432:5432
  7. environment:
  8. - POSTGRES_USER=postgres
  9. - POSTGRES_PASSWORD=postgres
  10. # You definitly need some tools to visualize/edit/debug your database right?
  11. yourprojectname-pgadmin:
  12. image: dpage/pgadmin4
  13. ports:
  14. - 8888:80
  15. environment:
  16. - PGADMIN_DEFAULT_EMAIL=user@domain.com
  17. - PGADMIN_DEFAULT_PASSWORD=SuperSecret
  18. links:
  19. # SERVICE:ALIAS
  20. # Link your db service to database domain, so that in pgadmin you can use postgres://database:5432... to access your db
  21. - "db:database"
  22. # your go enviroment
  23. workspace:
  24. image: golang:1.10
  25. # why we need a container_name here? just easy for you to attach
  26. container_name: workspace
  27. ports:
  28. - 8080:80
  29. volumes:
  30. # attach folder of your project in local filesystem to this container
  31. - ".:{your path}"
  32. environment:
  33. - PGURL=postgres://postgres:postgres@database:5432/postgres?sslmode=disable
  34. - PORT=80
  35. # change the path to your project root here so that once you attach this container, you will be in the project root
  36. command: bash -c "cd /go/src/... && bash"
  37. stdin_open: true
  38. tty: true
  39. links:
  40. # so that this container can access your database service using postgres://database...
  41. - "db:database"
Add Comment
Please, Sign In to add comment