Gitpod improvements for initial load and persisting gems in container (#14764)

This commit is contained in:
Nick Taylor 2021-09-21 10:32:22 -04:00 committed by GitHub
parent 9f0dfa3181
commit 009665ce2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View file

@ -2,8 +2,11 @@ FROM gitpod/workspace-postgres
# Install Ruby
ENV RUBY_VERSION=3.0.2
RUN rm /home/gitpod/.rvmrc && touch /home/gitpod/.rvmrc && echo "rvm_gems_path=/home/gitpod/.rvm" > /home/gitpod/.rvmrc
# Taken from https://www.gitpod.io/docs/languages/ruby
RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc
RUN bash -lc "rvm install ruby-$RUBY_VERSION && rvm use ruby-$RUBY_VERSION --default"
RUN echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc
# Install Node and Yarn
ENV NODE_VERSION=14.17.6
@ -15,6 +18,6 @@ ENV PATH=/home/gitpod/.nvm/versions/node/v${NODE_VERSION}/bin:$PATH
# Install Redis.
RUN sudo apt-get update \
&& sudo apt-get install -y \
redis-server \
&& sudo rm -rf /var/lib/apt/lists/*
&& sudo apt-get install -y \
redis-server \
&& sudo rm -rf /var/lib/apt/lists/*

View file

@ -13,16 +13,13 @@ ports:
tasks:
- name: Forem Server
before: |
redis-server &
init: >
gitpod-init.sh
before: redis-server &
init: ./gitpod-init.sh
command: bin/startup
- name: Open Site
command: >
bin/startup
- command: >
gp await-port 3000 &&
printf "Waiting for Forem server ..." &&
until $(curl -sNL $(gp url 3000) | grep -q "Forem"); do printf '.'; sleep 5; done && echo "" &&
printf "Waiting for local Forem development environment to load in the browser..." &&
gp preview $(gp url 3000)
github: