Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-compose stuck on building

Tags:

docker

angular

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"
like image 457
Noah Lc Avatar asked Sep 13 '26 18:09

Noah Lc


1 Answers

You may want to check if you have .dockerignore setup properly or not. In my case it helps.

like image 72
Dida Avatar answered Sep 15 '26 08:09

Dida



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!