diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..75267cd8fda --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,17 @@ +tasks: + - init: ./script/docker/init.sh + command: docker compose up -d web + +ports: + - port: 3000 + onOpen: open-browser + - port: 3306 + onOpen: ignore + - port: 6379 + onOpen: ignore + - port: 9200 + onOpen: ignore + - port: 9300 + onOpen: ignore + - port: 9400 + onOpen: ignore diff --git a/config/environments/development.rb b/config/environments/development.rb index cd68be1d8a8..22b8f24edde 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -82,4 +82,12 @@ Bullet.rails_logger = true Bullet.counter_cache_enable = false end + + # GitPod preview support; the preview URL begins with `port#-`, then details about the individual workspace. + # For more information about this, refer to https://www.gitpod.io/docs/configure/workspaces/ports#accessing-port-urls. + # Example: + # GITPOD_WORKSPACE_ID=brianjaustin-otwarchive-w2lj9jd79gm (username-repo-uuid) + # GITPOD_WORKSPACE_CLUSTER_HOST=ws-us114.gitpod.io + # results in 3000-brianjaustin-otwarchive-w2lj9jd79gm.ws-us114.gitpod.io + config.hosts << "3000-#{ENV['GITPOD_WORKSPACE_ID']}.#{ENV['GITPOD_WORKSPACE_CLUSTER_HOST']}" if ENV["GITPOD_WORKSPACE_ID"] end diff --git a/docker-compose.yml b/docker-compose.yml index 3e734fb7d7b..e37dea781ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,6 +73,8 @@ services: dockerfile: ./config/docker/Dockerfile environment: - RAILS_ENV=development + - GITPOD_WORKSPACE_ID=${GITPOD_WORKSPACE_ID:-} + - GITPOD_WORKSPACE_CLUSTER_HOST=${GITPOD_WORKSPACE_CLUSTER_HOST:-} command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" volumes: - .:/otwa