Answer the question
In order to leave comments, you need to log in
Why can't I run the html file in docker?
I just started learning docker, I decided to try to run a regular html file through tomcat using docker. I opened the package with the project where this html file exists, and created a Dockerfile at the very root
FROM tomcat
WORKDIR /app
COPY . .
RUN npm install
EXPOSE 3000
CMD ["tomcat","index.html"]
Answer the question
In order to leave comments, you need to log in
1) tomcat is a web application server that is written in Java , and the server itself is also written in Java . You can't run html in it, but you can run war or jar files !
2) html cannot be run at all! it can only be published to a web server that will serve it. I recommend doing this, for example, through nginx or apache http or nodejs .
3) I do not recommend serving html through tomcat if you do not program in java and related to the JVMprogramming languages ( kotlin , groovy , clojure , etc.)
Good afternoon.
You don't need a tomcat. It's expensive and inconvenient.
You need nginx.
Read this article:
https://medium.com/code-to-express/https-medium-co...
or this one:
https://www.dailysmarty.com/posts/steps-for-deploy. ..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question