mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 02:57:57 +00:00 
			
		
		
		
	chore: Fix codespaces not booting up (#8264)
Fixed an issue where the codespace was not correctly booting up. Fixes #7609 Co-authored-by: Liam Ashdown <liam.ashdown@debbiesvillas.co.uk> Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
		| @@ -1,10 +1,14 @@ | |||||||
|  |  | ||||||
| ARG VARIANT=ubuntu-20.04 | ARG VARIANT | ||||||
| FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT} |  | ||||||
|  | FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} | ||||||
|  |  | ||||||
|  | ARG NODE_VERSION | ||||||
|  | ARG RUBY_VERSION | ||||||
|  | ARG USER_UID | ||||||
|  | ARG USER_GID | ||||||
|  |  | ||||||
| # Update args in docker-compose.yaml to set the UID/GID of the "vscode" user. | # Update args in docker-compose.yaml to set the UID/GID of the "vscode" user. | ||||||
| ARG USER_UID=1000 |  | ||||||
| ARG USER_GID=$USER_UID |  | ||||||
| RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \ | RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \ | ||||||
|         groupmod --gid $USER_GID vscode \ |         groupmod --gid $USER_GID vscode \ | ||||||
|         && usermod --uid $USER_UID --gid $USER_GID vscode \ |         && usermod --uid $USER_UID --gid $USER_GID vscode \ | ||||||
| @@ -27,10 +31,10 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | |||||||
|     tmux \ |     tmux \ | ||||||
|     zsh \ |     zsh \ | ||||||
|     git-flow \ |     git-flow \ | ||||||
|     npm |     npm \ | ||||||
|  |     libyaml-dev | ||||||
|  |  | ||||||
| # Install rbenv and ruby | # Install rbenv and ruby | ||||||
| ARG RUBY_VERSION="3.2.2" |  | ||||||
| RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \ | RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \ | ||||||
|     &&  echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc \ |     &&  echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc \ | ||||||
|     &&  echo 'eval "$(rbenv init -)"' >> ~/.bashrc |     &&  echo 'eval "$(rbenv init -)"' >> ~/.bashrc | ||||||
| @@ -65,8 +69,7 @@ COPY Gemfile Gemfile.lock ./ | |||||||
| RUN gem install bundler && bundle install | RUN gem install bundler && bundle install | ||||||
|  |  | ||||||
| # set up node js | # set up node js | ||||||
| RUN npm install npm@latest -g && \ | RUN npm install n -g && \ | ||||||
|     npm install n -g && \ |     n $NODE_VERSION | ||||||
|     n latest |  | ||||||
| RUN npm install --global yarn | RUN npm install --global yarn | ||||||
| RUN yarn | RUN yarn | ||||||
|   | |||||||
| @@ -5,19 +5,30 @@ | |||||||
| version: '3' | version: '3' | ||||||
|  |  | ||||||
| services: | services: | ||||||
|  |   base:  | ||||||
|  |     build: | ||||||
|  |       context: .. | ||||||
|  |       dockerfile: .devcontainer/Dockerfile.base | ||||||
|  |       args: | ||||||
|  |         VARIANT: "ubuntu-22.04" | ||||||
|  |         NODE_VERSION: "20.9.0" | ||||||
|  |         RUBY_VERSION: "3.2.2" | ||||||
|  |         # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000. | ||||||
|  |         USER_UID: "1000" | ||||||
|  |         USER_GID: "1000" | ||||||
|  |     image: base:latest | ||||||
|  |          | ||||||
|   app: |   app: | ||||||
|     build: |     build: | ||||||
|       context: .. |       context: .. | ||||||
|       dockerfile: .devcontainer/Dockerfile |       dockerfile: .devcontainer/Dockerfile | ||||||
|       args: |       args: | ||||||
|         # Update 'VARIANT' to pick a Ruby version: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/ruby |         VARIANT: "ubuntu-22.04" | ||||||
|         VARIANT: 3 |         NODE_VERSION: "20.9.0" | ||||||
|         # [Choice] Install Node.js |         RUBY_VERSION: "3.2.2" | ||||||
|         INSTALL_NODE: "true" |  | ||||||
|         NODE_VERSION: "lts/*" |  | ||||||
|         # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000. |         # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000. | ||||||
|         USER_UID: 1000 |         USER_UID: "1000" | ||||||
|         USER_GID: 1000 |         USER_GID: "1000" | ||||||
|  |  | ||||||
|     volumes: |     volumes: | ||||||
|       - ..:/workspace:cached |       - ..:/workspace:cached | ||||||
| @@ -53,4 +64,3 @@ services: | |||||||
| volumes: | volumes: | ||||||
|   postgres-data: |   postgres-data: | ||||||
|   redis-data: |   redis-data: | ||||||
|    |  | ||||||
| @@ -19,5 +19,6 @@ jobs: | |||||||
|  |  | ||||||
|     - name: Build the Codespace Base Image |     - name: Build the Codespace Base Image | ||||||
|       run: | |       run: | | ||||||
|         docker build . -t ghcr.io/chatwoot/chatwoot_codespace:latest -f .devcontainer/Dockerfile.base  |         docker-compose -f .devcontainer/docker-compose.yml build base | ||||||
|  |         docker tag base:latest ghcr.io/chatwoot/chatwoot_codespace:latest | ||||||
|         docker push ghcr.io/chatwoot/chatwoot_codespace:latest |         docker push ghcr.io/chatwoot/chatwoot_codespace:latest | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Liam
					Liam