Skip to content

Commit

Permalink
fix front dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mariemeSall committed Jan 31, 2024
1 parent 41199b2 commit 9a73921
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 17 additions & 5 deletions front/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . .
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

0 comments on commit 9a73921

Please sign in to comment.