Answer the question
In order to leave comments, you need to log in
Docker and angular CLI: why doesn't it work?
I use:
FROM node:latest AS buildContainer
COPY . /app
WORKDIR /app
# Copy dependency definitions
RUN npm install
RUN npm run build
FROM nginx:latest
RUN apt-get update
COPY nginx.conf /etc/nginx/nginx.conf
COPY gzip.conf /etc/nginx/gzip.conf
COPY mime.types /etc/nginx/mime.types
COPY --from=buildContainer /app/dist/ /usr/share/nginx/html
EXPOSE 9000/tcp
[email protected]:/usr/share/nginx/html# ls
50x.html index.html main.bundle.js.map styles.bundle.js
favicon.ico inline.bundle.js polyfills.bundle.js styles.bundle.js.map
fontello.078f910f70a2e032f1b6.eot inline.bundle.js.map polyfills.bundle.js.map vendor.bundle.js
fontello.42641586af6054f0f7e6.svg main.bundle.js scripts.bundle.js vendor.bundle.js.map
Answer the question
In order to leave comments, you need to log in
Thanks RidgeA for the help! It turns out that the problem was that I was compiling with the docker build -t [имя_контейнера]
. It is not right. You need to download the Docker extension for VS Code and call it to build and run the container, it does all the work. Thanks everyone!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question