I have problem with serving Angular app using nginx on docker. Problem is only when I want to turn on SSL on site. I'm using Bamboo for deployment.
Here is my Dockerfile:
FROM node:8.6 as node
WORKDIR /app
COPY package.json /app/
COPY ssl/certificate.crt /app/
COPY ssl/ /app/ssl
RUN npm install -g @angular/cli --unsafe
RUN npm install
COPY ./ /app/
RUN ng build --prod --aot=false --env=prod
FROM nginx
RUN mkdir -p /ssl
COPY --from=node /app/ssl/ /ssl/
ADD ssl/certificate.crt /etc/nginx/certs/
ADD ssl/private.key /etc/nginx/certs/
RUN ls /etc/nginx/certs/
COPY --from=node /app/dist/ /usr/share/nginx/html
RUN ls /usr/share/nginx/html
Script to run:
docker build -t test-app .
docker run --name test-app-cont -v /etc/nginx/certs:/etc/nginx/certs -d -p 3010:443 test-app
Deployment runs successfully, but there is no app on server served.
Please have a look at this screen: There is listed what is in /certs and /html directories. Everything seems to be good.
If I remove these lines dedicated to SSL, everything works fine, and on server I can see my app, but only through http.
The certificates are valid, I checked.
What am I doing wrong?
