2023-04-03 21:47:18 +00:00
|
|
|
# To make it easier to self-host, we have a preset docker compose config that also
|
|
|
|
# has a container with a Postgres instance running.
|
|
|
|
# You can tweak around this file to match your instances
|
2019-09-27 12:06:51 +00:00
|
|
|
version: "3.7"
|
|
|
|
|
|
|
|
services:
|
2023-04-03 21:47:18 +00:00
|
|
|
# This service runs the backend app in the port 3170
|
|
|
|
hoppscotch-backend:
|
|
|
|
container_name: hoppscotch-backend
|
2019-09-27 12:06:51 +00:00
|
|
|
build:
|
2023-08-23 18:31:28 +00:00
|
|
|
dockerfile: prod.Dockerfile
|
2019-09-27 12:06:51 +00:00
|
|
|
context: .
|
2023-08-23 18:31:28 +00:00
|
|
|
target: backend
|
2023-04-03 21:47:18 +00:00
|
|
|
env_file:
|
|
|
|
- ./.env
|
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
# Edit the below line to match your PostgresDB URL if you have an outside DB (make sure to update the .env file as well)
|
|
|
|
- DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch?connect_timeout=300
|
2023-11-22 14:05:35 +00:00
|
|
|
- PORT=8080
|
2019-09-27 12:06:51 +00:00
|
|
|
volumes:
|
2023-07-17 15:52:56 +00:00
|
|
|
# Uncomment the line below when modifying code. Only applicable when using the "dev" target.
|
|
|
|
# - ./packages/hoppscotch-backend/:/usr/src/app
|
2023-04-03 21:47:18 +00:00
|
|
|
- /usr/src/app/node_modules/
|
|
|
|
depends_on:
|
2023-07-17 15:52:56 +00:00
|
|
|
hoppscotch-db:
|
|
|
|
condition: service_healthy
|
2019-09-27 12:06:51 +00:00
|
|
|
ports:
|
2023-11-22 14:05:35 +00:00
|
|
|
- "3180:80"
|
2023-08-23 18:31:28 +00:00
|
|
|
- "3170:3170"
|
2023-04-03 21:47:18 +00:00
|
|
|
|
|
|
|
# The main hoppscotch app. This will be hosted at port 3000
|
|
|
|
# NOTE: To do TLS or play around with how the app is hosted, you can look into the Caddyfile for
|
|
|
|
# the SH admin dashboard server at packages/hoppscotch-selfhost-web/Caddyfile
|
|
|
|
hoppscotch-app:
|
|
|
|
container_name: hoppscotch-app
|
|
|
|
build:
|
2023-08-23 18:31:28 +00:00
|
|
|
dockerfile: prod.Dockerfile
|
2023-04-03 21:47:18 +00:00
|
|
|
context: .
|
2023-08-23 18:31:28 +00:00
|
|
|
target: app
|
2023-04-03 21:47:18 +00:00
|
|
|
env_file:
|
|
|
|
- ./.env
|
|
|
|
depends_on:
|
|
|
|
- hoppscotch-backend
|
|
|
|
ports:
|
2023-11-22 14:05:35 +00:00
|
|
|
- "3080:80"
|
|
|
|
- "3000:3000"
|
2023-04-03 21:47:18 +00:00
|
|
|
|
|
|
|
# The Self Host dashboard for managing the app. This will be hosted at port 3100
|
|
|
|
# NOTE: To do TLS or play around with how the app is hosted, you can look into the Caddyfile for
|
|
|
|
# the SH admin dashboard server at packages/hoppscotch-sh-admin/Caddyfile
|
|
|
|
hoppscotch-sh-admin:
|
|
|
|
container_name: hoppscotch-sh-admin
|
|
|
|
build:
|
2023-08-23 18:31:28 +00:00
|
|
|
dockerfile: prod.Dockerfile
|
2023-04-03 21:47:18 +00:00
|
|
|
context: .
|
2023-08-23 18:31:28 +00:00
|
|
|
target: sh_admin
|
2023-04-03 21:47:18 +00:00
|
|
|
env_file:
|
|
|
|
- ./.env
|
|
|
|
depends_on:
|
|
|
|
- hoppscotch-backend
|
|
|
|
ports:
|
2023-11-22 14:05:35 +00:00
|
|
|
- "3280:80"
|
|
|
|
- "3100:3100"
|
2023-04-03 21:47:18 +00:00
|
|
|
|
2023-08-23 18:31:28 +00:00
|
|
|
# The service that spins up all 3 services at once in one container
|
|
|
|
hoppscotch-aio:
|
|
|
|
container_name: hoppscotch-aio
|
2023-12-12 10:42:58 +00:00
|
|
|
restart: unless-stopped
|
2023-08-23 18:31:28 +00:00
|
|
|
build:
|
|
|
|
dockerfile: prod.Dockerfile
|
|
|
|
context: .
|
|
|
|
target: aio
|
|
|
|
env_file:
|
|
|
|
- ./.env
|
|
|
|
depends_on:
|
|
|
|
hoppscotch-db:
|
|
|
|
condition: service_healthy
|
|
|
|
ports:
|
|
|
|
- "3000:3000"
|
|
|
|
- "3100:3100"
|
|
|
|
- "3170:3170"
|
2023-11-22 14:05:35 +00:00
|
|
|
- "3080:80"
|
2023-08-23 18:31:28 +00:00
|
|
|
|
2023-04-03 21:47:18 +00:00
|
|
|
# The preset DB service, you can delete/comment the below lines if
|
|
|
|
# you are using an external postgres instance
|
|
|
|
# This will be exposed at port 5432
|
|
|
|
hoppscotch-db:
|
2023-07-17 15:52:56 +00:00
|
|
|
image: postgres:15
|
2023-04-03 21:47:18 +00:00
|
|
|
ports:
|
|
|
|
- "5432:5432"
|
2023-07-17 15:52:56 +00:00
|
|
|
user: postgres
|
2020-08-23 23:48:02 +00:00
|
|
|
environment:
|
2023-07-17 15:52:56 +00:00
|
|
|
# The default user defined by the docker image
|
|
|
|
POSTGRES_USER: postgres
|
2023-04-03 21:47:18 +00:00
|
|
|
# NOTE: Please UPDATE THIS PASSWORD!
|
|
|
|
POSTGRES_PASSWORD: testpass
|
|
|
|
POSTGRES_DB: hoppscotch
|
2023-07-17 15:52:56 +00:00
|
|
|
healthcheck:
|
2023-08-23 18:31:28 +00:00
|
|
|
test:
|
|
|
|
[
|
|
|
|
"CMD-SHELL",
|
|
|
|
"sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'"
|
|
|
|
]
|
2023-07-17 15:52:56 +00:00
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
2023-04-03 21:47:18 +00:00
|
|
|
|
2023-08-23 18:31:28 +00:00
|
|
|
# All the services listed below are deprececated
|
|
|
|
hoppscotch-old-backend:
|
|
|
|
container_name: hoppscotch-old-backend
|
|
|
|
build:
|
|
|
|
dockerfile: packages/hoppscotch-backend/Dockerfile
|
|
|
|
context: .
|
2024-03-14 16:16:34 +00:00
|
|
|
target: prod
|
2023-08-23 18:31:28 +00:00
|
|
|
env_file:
|
|
|
|
- ./.env
|
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
# Edit the below line to match your PostgresDB URL if you have an outside DB (make sure to update the .env file as well)
|
2024-03-05 12:35:58 +00:00
|
|
|
- DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch?connect_timeout=300
|
2023-08-23 18:31:28 +00:00
|
|
|
- PORT=3000
|
|
|
|
volumes:
|
|
|
|
# Uncomment the line below when modifying code. Only applicable when using the "dev" target.
|
2024-03-14 16:16:34 +00:00
|
|
|
# - ./packages/hoppscotch-backend/:/usr/src/app
|
2023-08-23 18:31:28 +00:00
|
|
|
- /usr/src/app/node_modules/
|
|
|
|
depends_on:
|
|
|
|
hoppscotch-db:
|
|
|
|
condition: service_healthy
|
|
|
|
ports:
|
|
|
|
- "3170:3000"
|
|
|
|
|
|
|
|
hoppscotch-old-app:
|
|
|
|
container_name: hoppscotch-old-app
|
|
|
|
build:
|
|
|
|
dockerfile: packages/hoppscotch-selfhost-web/Dockerfile
|
|
|
|
context: .
|
|
|
|
env_file:
|
|
|
|
- ./.env
|
|
|
|
depends_on:
|
|
|
|
- hoppscotch-old-backend
|
|
|
|
ports:
|
|
|
|
- "3000:8080"
|
2023-04-03 21:47:18 +00:00
|
|
|
|
2023-08-23 18:31:28 +00:00
|
|
|
hoppscotch-old-sh-admin:
|
|
|
|
container_name: hoppscotch-old-sh-admin
|
|
|
|
build:
|
|
|
|
dockerfile: packages/hoppscotch-sh-admin/Dockerfile
|
|
|
|
context: .
|
|
|
|
env_file:
|
|
|
|
- ./.env
|
|
|
|
depends_on:
|
|
|
|
- hoppscotch-old-backend
|
|
|
|
ports:
|
|
|
|
- "3100:8080"
|