diff --git a/docker-compose.yml b/docker-compose.yml index f11be7a..e6ddd9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,9 +43,6 @@ services: container_name: kafka_front_container ports: - "4200:4200" - volumes : - - ./front:/app - command: ng serve --host 0.0.0.0 networks: - kafka_net depends_on: diff --git a/front/Dockerfile b/front/Dockerfile index d4beca7..60bf4ac 100644 --- a/front/Dockerfile +++ b/front/Dockerfile @@ -1,7 +1,19 @@ -FROM node:20.9-alpine AS build +FROM ubuntu +SHELL ["/bin/bash", "-c"] +ENV NVM_DIR /usr/local/.nvm +ENV NODE_VERSION v18.16 +RUN mkdir $NVM_DIR +RUN cat /etc/resolv.conf +RUN apt-get update && apt-get -y install curl +RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash +ENV NODE_PATH $NVM_DIR/$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH +RUN echo "source $NVM_DIR/nvm.sh && \ + nvm install $NODE_VERSION && \ + nvm alias default $NODE_VERSION && \ + nvm use default" | bash WORKDIR /app -RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf && npm install -g @angular/cli COPY package*.json ./ -RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf && npm install -RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf && npm audit fix -COPY . . \ No newline at end of file +RUN source $NVM_DIR/nvm.sh && npm install +COPY . . +CMD source $NVM_DIR/nvm.sh && node_modules/.bin/ng serve --host 0.0.0.0 \ No newline at end of file