From a10bc457d8562967cf6c368e0cefa5e1eca57cad Mon Sep 17 00:00:00 2001 From: Yonatan Mark Liudmirsky <45634836+YonLiud@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:52:36 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B1=20-=20Enhanced=20Cross-Platform=20?= =?UTF-8?q?Compatibility=20and=20Docker=20Environment=20Setup=20(#374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matan Mashraki <12946462+planecore@users.noreply.github.com> --- .dockerignore | 6 ++++++ Dockerfile | 20 ++++++++++++++++++++ android/gradle.properties | 2 +- package.json | 4 ++-- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..75b6df4d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +.git +.gitignore +.dockerignore +Dockerfile +README.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..54622b79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM node:22 + +ENV ENVIRONMENT=development + +WORKDIR /usr/src/app + +COPY package.json yarn.lock ./ + +COPY . . + +RUN yarn install --verbose + +RUN yarn rename-dev-configs + +EXPOSE 8081 + +# To start the app after building it using `docker build -t better-rail-app .` with docker +# run: `docker run -it -p 8081:8081 better-rail-app yarn start` + +# CMD ["yarn", "start"] \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties index 3f57fedd..9c966f27 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -10,7 +10,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m -org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m +org.gradle.jvmargs=-Xmx1024m -XX:MaxMetaspaceSize=256m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/package.json b/package.json index db44ec18..0777d41c 100644 --- a/package.json +++ b/package.json @@ -20,10 +20,10 @@ "storybook": "start-storybook -p 9001 -c ./storybook", "test": "jest", "adb": "adb reverse tcp:9090 tcp:9090 && adb reverse tcp:3000 tcp:3000 && adb reverse tcp:9001 tcp:9001 && adb reverse tcp:8081 tcp:8081", - "postinstall": "patch-package; node ./bin/postInstall;", + "postinstall": "patch-package && node ./bin/postInstall", "build-ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios", "build-android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res", - "rename-dev-configs": "cp ios/GoogleService-Info.development.plist ios/GoogleService-Info.plist; cp android/app/google-services.development.json android/app/google-services.json" + "rename-dev-configs": "cp ios/GoogleService-Info.development.plist ios/GoogleService-Info.plist && cp android/app/google-services.development.json android/app/google-services.json" }, "dependencies": { "@expo/react-native-action-sheet": "4.0.1",