Ich habe versucht, ein Bild für eine App mit angle-cli als Controller zu bauen. In der Build-Zeit mit dem Befehl ng build --prod
stürzt der Docker Builder ab.angular-cli ng command nicht gefunden, auch wenn es installiert ist, während Docker ein Bild erstellt
Ich habe versucht, angular-CLI auf globalen oder lokalen Ordner zu implementieren, aber jedes Mal, ng
Befehl heißt, bauen Konsole sagt, dass es nicht auf einem Ordner erstellen kann, die keine angular-CLI App ist.
Das Problem ist, dass Docker Build-Prozess ng build
auf den richtigen Ordner ausführen. Hier ist meine Docker-Datei.
Fehlermeldung: The command '/bin/sh -c ng build --prod' returned a non-zero code: 127
Andere Fehlermeldung: /bin/sh: 1: ng: not found
FROM node:6.9.1
ENV DEBIAN_FRONTEND noninteractive
ADD ./ /opt/
RUN cd /opt/ && ls -l
### MYSQL
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
&& apt-get install -y mysql-client libmysqlclient-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# ORACLE
#INSTALL LIBAIO1 & UNZIP (NEEDED FOR STRONG-ORACLE)
RUN apt-get update \
&& apt-get install -y libaio1 \
&& apt-get install -y build-essential \
&& apt-get install -y unzip \
&& apt-get install -y curl
#ADD ORACLE INSTANT CLIENT
RUN mkdir -p opt/oracle
ADD ./oracle/linux/ .
RUN unzip instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
&& unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
&& mv /opt/oracle/instantclient_12_1 /opt/oracle/instantclient \
&& ln -s /opt/oracle/instantclient/libclntsh.so.12.1 /opt/oracle/instantclient/libclntsh.so \
&& ln -s /opt/oracle/instantclient/libocci.so.12.1 /opt/oracle/instantclient/libocci.so
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient"
ENV OCI_HOME="/opt/oracle/instantclient"
ENV OCI_LIB_DIR="/opt/oracle/instantclient"
ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient/sdk/include"
RUN echo '/opt/oracle/instantclient/' | tee -a /etc/ld.so.conf.d/oracle_instant_client.conf && ldconfig
EXPOSE 30009
### SQL SERVER
RUN npm install sql-cli -g
RUN npm install @angular/cli -g
RUN npm install typescript -g
RUN npm install typings -g
RUN npm cache clean && rm -rf ~/.npm
RUN cd /opt/
RUN rm -rf node_modules
RUN ls -l
RUN npm install --production --unsafe-perm
RUN npm cache clean
RUN cd /opt/ && ls -l
RUN ng build --prod
# PM2
RUN npm install pm2 -g
ENV NODE_ENV=production
# UP app
CMD cd /opt/ \
&& pm2-docker start dist/server/app.js