Skip to content

Commit

Permalink
AO3-6707 Add GitPod config (#4800)
Browse files Browse the repository at this point in the history
* AO3-6707 Add GitPod config

* Remove extensions, ignore port messages

* Better support for in-browser GitPod

* Add details about URL structure
  • Loading branch information
brianjaustin authored Jun 20, 2024
1 parent 325f5de commit f47e0f5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f47e0f5

Please sign in to comment.