chatwoot / docs

Official docs, handbook for Chatwoot
https://www.chatwoot.com/help-center
MIT License
43 stars 145 forks source link

Contributing Guide - Docker #448

Open sergbbb opened 1 year ago

sergbbb commented 1 year ago

Fix patch for Docker Contributing Guide

From 675f740810318b2430c48354a5d45bfc2028a327 Mon Sep 17 00:00:00 2001
From: Serhii Khoroshko <khoroshko@gmail.com>
Date: Sun, 3 Sep 2023 16:27:31 +0300
Subject: [PATCH] Fixes for Docker development start

---
 config/environments/development.rb    | 3 +++
 docker-compose.yaml                   | 1 +
 docker/Dockerfile                     | 2 +-
 docker/dockerfiles/webpack.Dockerfile | 2 ++
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/config/environments/development.rb b/config/environments/development.rb
index 557000065..680d0b2b0 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,6 +1,9 @@
 Rails.application.configure do
   # Settings specified here will take precedence over those in config/application.rb.

+  # Allow access from any IP
+  config.web_console.whitelisted_ips = ['127.0.0.0/8', '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
+
   # In the development environment your application's code is reloaded on
   # every request. This slows down response time but is perfect for development
   # since you don't have to restart the web server when you make code changes.
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 1fbf28da9..ecb34647d 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -79,6 +79,7 @@ services:
       - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
       - NODE_ENV=development
       - RAILS_ENV=development
+      - NODE_OPTIONS=--openssl-legacy-provider
     entrypoint: docker/entrypoints/webpack.sh
     command: bin/webpack-dev-server

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 676b5bf74..6503530b7 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -104,7 +104,7 @@ RUN apk update && apk add --no-cache \
   && gem install bundler

 RUN if [ "$RAILS_ENV" != "production" ]; then \
-  apk add --no-cache nodejs yarn; \
+  apk add --no-cache nodejs-current yarn; \
   fi

 COPY --from=pre-builder /gems/ /gems/
diff --git a/docker/dockerfiles/webpack.Dockerfile b/docker/dockerfiles/webpack.Dockerfile
index ec5cdc100..7acea4f2b 100644
--- a/docker/dockerfiles/webpack.Dockerfile
+++ b/docker/dockerfiles/webpack.Dockerfile
@@ -1,5 +1,7 @@
 FROM chatwoot:development

+RUN apk update && apk add --no-cache nodejs-current yarn
+
 RUN chmod +x docker/entrypoints/webpack.sh

 EXPOSE 3035
-- 
2.36.1.windows.1
pranavrajs commented 1 year ago

@vishnu-narayanan Please take a look.