diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile new file mode 100644 index 0000000000000..9cc14eaec3dea --- /dev/null +++ b/.gitpod.dockerfile @@ -0,0 +1,6 @@ +FROM gitpod/workspace-postgres + +# Install Ruby +COPY .ruby-version /tmp +RUN bash -lc "rvm install ruby-$(cat /tmp/.ruby-version)" \ + && rm -f /tmp/* diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000000000..e2484bdb28b84 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,24 @@ +image: + file: .gitpod.dockerfile +ports: + - port: 3000 + onOpen: open-preview + - port: 3035 + onOpen: ignore + - port: 5432 + onOpen: ignore +tasks: + - init: > + cp config/sample_application.yml config/application.yml && + bin/setup 2>/dev/null + command: > + while [ -z "${ALGOLIASEARCH_APPLICATION_ID:=$(cat config/application.yml | grep ALGOLIASEARCH_APPLICATION_ID | sed 's/.*:\s*//')}" ] || + [ -z "${ALGOLIASEARCH_SEARCH_ONLY_KEY:=$(cat config/application.yml | grep ALGOLIASEARCH_SEARCH_ONLY_KEY | sed 's/.*:\s*//')}" ] || + [ -z "${ALGOLIASEARCH_API_KEY:=$(cat config/application.yml | grep ALGOLIASEARCH_API_KEY | sed 's/.*:\s*//')}" ] ; do + gp open config/application.yml 2>/dev/null && + printf "\nā— Dev.to requires free Algolia credentials.\n" && + printf "ā— To get them, please follow https://docs.dev.to/get-api-keys-dev-env/#algolia\n\n" && + read -p "Add them to config/application.yml, save the file, and press any key to continue... " -n 1 -r + done ; + bin/setup && + bin/startup diff --git a/README.md b/README.md index 877553a7ce723..d6229a190ece2 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,12 @@ Our docker implementation is incomplete and may not work smoothly. Please kindly 1. run `docker-compose up` 1. That's it! Navigate to `localhost:3000` +### Gitpod Installation + +Simply open dev.to in Gitpod, a free online dev environment for GitHub: + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/thepracticaldev/dev.to) + #### Starting the application We're mostly a Rails app, with a bit of Webpack sprinkled in. **For most cases, simply running `bin/rails server` will do.** If you're working with Webpack though, you'll need to run the following: