Благодаря Гильермо.Я нашел ответ на это.Причина, по которой я не смог успешно развернуть предыдущие образы док-станции, заключается в том, что я пытался предоставить порт, который не является 8080
. По умолчанию механизм приложений прослушивает порт 8080 и ожидает, что файл конфигурации nginxиспользовать тот же «прослушивающий» порт для этого. Кроме того, по умолчанию ядро приложения предоставляет SSL, поэтому нет необходимости использовать nginx с SSL.
Вот измененные версии nginx.conf
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logs will appear on the Google Developer's Console when logged to this
# directory.
access_log /var/log/app_engine/app.log;
error_log /var/log/app_engine/app.log;
root /usr/share/nginx/html;
server {
# Google App Engine expects the runtime to serve HTTP traffic from
# port 8080.
listen 8080;
}
location / {
try_files $uri $uri/ /index.html =404;
}
}
Вот новый файл Docker
FROM node:8.12.0-alpine as builder
#Now install angular cli globally
RUN npm install -g @angular/cli
RUN apk add --update git openssh
#create a new direcotry for the prj and change its directory to it
RUN mkdir ./test
#copy the package json #dont copy package.lock json now
COPY package.json package-lock.json ./adtech-prj/
#this is required to place all our files inside this directory
WORKDIR ./test
#this copies all files to the working directory
COPY . .
RUN ng set -g warnings.versionMismatch=false
RUN npm cache clear --force && npm i
#Build the angular app in production mode and store the artifacts in dist
folder
RUN $(npm bin)/ng build --prod
### STAGE 2: Setup ###
FROM nginx:1.15-alpine
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
COPY nginx.conf /etc/nginx/conf.d/
# create log dir configured in nginx.conf
RUN mkdir -p /var/log/app_engine
RUN mkdir -p /usr/share/nginx/_ah && \
echo "healthy" > /usr/share/nginx/_ah/health
## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /adtech-prj/dist /usr/share/nginx/html
RUN chmod -R a+r /usr/share/nginx/html