docker-compose.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # To make it easier to self-host, we have a preset docker compose config that also
  2. # has a container with a Postgres instance running.
  3. # You can tweak around this file to match your instances
  4. version: "3.7"
  5. services:
  6. # This service runs the backend app in the port 3170
  7. hoppscotch-backend:
  8. container_name: hoppscotch-backend
  9. build:
  10. dockerfile: packages/hoppscotch-backend/Dockerfile
  11. context: .
  12. target: prod
  13. env_file:
  14. - ./.env
  15. restart: always
  16. environment:
  17. # Edit the below line to match your PostgresDB URL if you have an outside DB (make sure to update the .env file as well)
  18. - DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch?connect_timeout=300
  19. - PORT=3000
  20. volumes:
  21. - ./packages/hoppscotch-backend/:/usr/src/app
  22. - /usr/src/app/node_modules/
  23. depends_on:
  24. - hoppscotch-db
  25. ports:
  26. - "3170:3000"
  27. # The main hoppscotch app. This will be hosted at port 3000
  28. # NOTE: To do TLS or play around with how the app is hosted, you can look into the Caddyfile for
  29. # the SH admin dashboard server at packages/hoppscotch-selfhost-web/Caddyfile
  30. hoppscotch-app:
  31. container_name: hoppscotch-app
  32. build:
  33. dockerfile: packages/hoppscotch-selfhost-web/Dockerfile
  34. context: .
  35. env_file:
  36. - ./.env
  37. depends_on:
  38. - hoppscotch-backend
  39. ports:
  40. - "3000:8080"
  41. # The Self Host dashboard for managing the app. This will be hosted at port 3100
  42. # NOTE: To do TLS or play around with how the app is hosted, you can look into the Caddyfile for
  43. # the SH admin dashboard server at packages/hoppscotch-sh-admin/Caddyfile
  44. hoppscotch-sh-admin:
  45. container_name: hoppscotch-sh-admin
  46. build:
  47. dockerfile: packages/hoppscotch-sh-admin/Dockerfile
  48. context: .
  49. env_file:
  50. - ./.env
  51. depends_on:
  52. - hoppscotch-backend
  53. ports:
  54. - "3100:8080"
  55. # The preset DB service, you can delete/comment the below lines if
  56. # you are using an external postgres instance
  57. # This will be exposed at port 5432
  58. hoppscotch-db:
  59. image: postgres
  60. ports:
  61. - "5432:5432"
  62. environment:
  63. # NOTE: Please UPDATE THIS PASSWORD!
  64. POSTGRES_PASSWORD: testpass
  65. POSTGRES_DB: hoppscotch