I got my mean stack code working in a docker-compose configuration. If I run docker-compose up
on my pc, then I can login to my app successfully on localhost
If go to app service and click on docker-compose preview option and upload my docker-compose.yml file. After deploying it, when I click on the URL for the app I get application error and I'm not sure why. Perhaps I have to change something in my files to make it work in different environment? I appreciate any help with this!
I read somewhere that I don't have to provide username,password, or url details if using ACR in same subscription, which it is. So if that's the case, then authentication isn't the issue.
The frontend docker image and backend docker image are located in the azure container registry. I'm pointing to the registry when I setup docker in app service The docker logs from azure say
2020-02-19 15:08:20.257 INFO - Starting multi-container app, configuration =
2020-02-19 15:08:22.806 ERROR - Pull image threw Exception: Object reference not set to an instance of an object.
2020-02-19 15:08:22.806 ERROR - Pulling docker image failed:
2020-02-19 15:08:22.806 ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2020-02-19 15:08:22.806 ERROR - multi-container unit was not started successfully
2020-02-19 15:08:22.831 INFO - Container logs from testinggc_backend_0_250edca0 =
2020-02-19 15:08:28.902 INFO - Stoping site testinggc because it failed during startup.
2020-02-19 15:08:30.129 INFO - Starting multi-container app, configuration =
frontend Dockerfile
FROM node
MAINTAINER Phil
WORKDIR /src
COPY . .
RUN npm install
RUN npm install -g @angular/cli
EXPOSE 4200
CMD ng serve --host 0.0.0.0 --port 4200
backend Dockerfile
FROM node:10.16.3
MAINTAINER Phil
WORKDIR /src
COPY . /src
RUN npm install
RUN npm install -g nodemon
EXPOSE 3000
CMD ["npm", "run", "start"]
docker-compose.yml
version: '3'
services:
backend:
build: ./backend
ports:
- "3000:3000"
frontend:
build: ./frontend
ports:
- "4200:80"