I have an app Django in back-end and angular in front-end. It builds and works with no issue locally.
Now I want to create docker image for front-end. I have already create it for django and it work well.
But when i added docker file for angular, and when i'm trying to build container of front-end it stuck in Building frontend
Dockerfile:
FROM node:8.11.2-alpine as node
# Set working directory.
RUN mkdir /frontend
WORKDIR /frontend
# Copy app dependencies.
COPY package*.json ./frontendd
# Install app dependencies.
RUN npm install
# Copy app files.
COPY . /frontend
RUN npm run build
docker-compose:
version: '3'
services:
....some of code...
frontend:
container_name: frontend_dev_blog
build: ./frontend
command: "npm start"
volumes:
- ./frontend:/frontend
ports:
- "4200:4200"
expose:
- "4200"
You may want to check if you have .dockerignore setup properly or not. In my case it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With