Ritu Singh
Problem:
I have dockerized a react native app.
And I try now to deploy the app to the Auzure environment with recourse a app service. And the app works on localhost
This is the url: https://dierenfront.azurewebsites.net
But I get this error:
But if look in the log stream I see this:
So it looks like it wants to build to localhost?
I don't understand this.
This is the dockerfile:
package.json
And if I do a docker build -t dwl_frontend . I get this error:
and docker.compose.yml file:
Question: What I have to change so that the app on azure is working?
Solution:
The "Application Error" indicates that your React Native app is trying to connect to http://localhost:8081 while running in the Azure environment, which is causing the application error.
I created a React application in Azure App Service with Docker by following the below steps.
Create React Native App: Make sure React Native web app is ready for deployment. You should have a Dockerfile in the same directory.
Dockerfile
Created a Docker image using the Dockerfile with the following command.
Docker commands to push the image to ACR.
Docker Image:
Image has been pushed to ACR.
Once the image is pushed to ACR, you can create a web application with Docker configurations, like below.
Here are the results of the App Service with the Docker image.
Here are the results from my Log_stream.
Suggested blogs:
>Step by Step guide to Deploy Terraform in Azure using GitHub Actions
>Testing react components using Hooks and Mocks
>Use Firebase Realtime Database with ASP.NET MVC App
>Use of Singletons in .NET Core in AWS Lambda
>How to do PHP Decryption from Node.js Encryption
>How to Set up the Android emulator?
>How to Set up the local environment for Angular development?
>How to solve encoding issue when writing to a text file, with Python?