Forum Discussion

iqbalcodes6602's avatar
iqbalcodes6602
Copper Contributor
Jul 01, 2024

Error in connecting containers in Azure App service through docker compose

version: '3'

 

services:
  frontend:
    image: iqbalcodes6602/occ-frontend:latest
    container_name: frontend
    ports:
      - "3000:3000"
    stdin_open: true
    tty: true
    depends_on:
      - backend
    networks:
      - app-net
    environment:
      - REACT_APP_BACKEND_URL=http://backend:5000/runcode/

 

  backend:
    image: iqbalcodes6602/occ-backend:latest
    container_name: backend
    ports:
      - "5000:5000"
    networks:
      - app-net
 
networks:
  app-net:
    driver: bridge


when i run docker compose up locally it works fine, but when i deploy it in Azure app serice through docker compose it doesn't work it gives mixed content error, 

App.js:29 Mixed Content: The page at 'https://<domain>.azurewebsites.net/' was loaded over HTTPS, but requested an insecure resource 'http://backend:5000/runcode/'. This request has been blocked; the content must be served over HTTPS.
 
i have somequestion- 
1. when i deploy it azure give me default domain going to which i can acces my react frontend how can i access the backend
2. how to connect the frontend and backend containers

Resources