I am developing a WebApp in React in VS-Code and I want to deploy it on Azure Web App Services.
First I tried using the github pipelines, it builded and deployed successfully, but seems not to work with free plans. Indeed, If I try to set up the pipeline using VS-Code UI, my app service is not visible.
Then I tried to use Docker, created the Dockerfile. First I tried to use serve as web server with the following Dockerfile:
FROM node:14-alpine as build
RUN npm install -g serve
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm build
EXPOSE 80
CMD [ "serve", "-s", "build", "-l", "80" ]
When I navigate to my website I get a 404.
Last try, using nginx, with the following Dockerfile:
FROM node:14-alpine as build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
RUN npm run build
FROM nginx:1.20-alpine
ENV NGINX_PROTOCOL http2
COPY --from=build /app/public /usr/share/nginx/html
COPY nginx-config /etc/nginx
Here I get :( Application Error. If you are the application administrator, you can access the diagnostic resources.
Why is Azure so complicated?
Please need help.
I also tried to follow this, it deploys, but if I browse the app I get:
And in the logs I find:
2021-07-07T08:26:19.215Z ERROR - Container XXXXXXX for site XXXXXXX did not start within expected time limit. Elapsed time = 230.9546994 sec 2021-07-07T08:26:19.233Z ERROR - Container XXXXXXX didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.