Docker Community Forums

Share and learn in the Docker community.

AWS / docker / angular / nginx not working


(Mhalbig) #1

Hi,

I have an angular app with nginx proxy server. This is my dockerfile:

Stage 0, based on Node.js, to build and compile Angular

FROM node:8.11.3 as node
WORKDIR /app
COPY package.json /app/
RUN npm install
COPY ./ /app/
ARG env=prod
RUN npm run build – --prod --environment $env

Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx

FROM nginx:1.13
COPY --from=node /app/dist/ /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

It works perfectly fine on my local machine with docker run. I tried to deploy this to AWS ECS but it doesnt work. AWS starts my task but it ends immediately with exit code 1.

Any idea?

Rgds
Michael