Skip to content

Commit

Permalink
chore: adds Gitpod Flex support
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogarim committed Jan 9, 2025
1 parent 6ec661b commit f3aafb6
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Use a base image with Ubuntu
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu

# Copy package.json to the container
COPY package.json /tmp/package.json

# Install necessary packages
RUN apt-get update && apt-get install -y \
apt-transport-https \
build-essential \
ca-certificates \
curl \
git \
jq \
libssl-dev && \
rm -rf /var/lib/apt/lists/*

# Extract Node.js version from package.json
RUN NODE_VERSION=$(jq -r '.engines.node' /tmp/package.json) && \
echo "Node version from package.json: $NODE_VERSION"

# Install Node.js and npm
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs

# Install Deno
RUN curl -fsSL https://deno.land/install.sh | sh && \
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> /etc/bash.bashrc

# Install NVM and set Node version
ENV NVM_DIR=/root/.nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash && \
. $NVM_DIR/nvm.sh && \
NODE_VERSION=$(jq -r '.engines.node' /tmp/package.json) && \
nvm install $NODE_VERSION && \
nvm use $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
echo 'export NVM_DIR="$NVM_DIR"' >> /etc/bash.bashrc && \
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /etc/bash.bashrc && \
echo 'export PATH="$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH"' >> /etc/bash.bashrc

# Install Yarn globally
RUN npm install -g yarn

# Install Meteor
RUN curl https://install.meteor.com/?release=$(curl -so- https://raw.githubusercontent.com/RocketChat/Rocket.Chat/develop/apps/meteor/.meteor/release | cut -d@ -f2) | sh && \
echo 'export PATH=$PATH:/home/gitpod/.meteor' >> /etc/bash.bashrc

# Set the working directory to ensure permissions are correct
WORKDIR /workspaces/Rocket.Chat

# Install dependencies
RUN yarn
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Rocket.Chat Gitpod",
"build": {
"context": "..",
"dockerfile": "./Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"forwardPorts": [3000],
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode"
]
}
}
}
File renamed without changes.
11 changes: 11 additions & 0 deletions .gitpod/automations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
development-server:
name: Rocket.Chat development server
description: Starts the Rocket.Chat development server
triggeredBy:
- postDevcontainerStart
- manual
commands:
start: |
nvm use $(jq -r '.engines.node' package.json) && \
yarn dsv

0 comments on commit f3aafb6

Please sign in to comment.