Dockerfile setup [closed]
-
I am not proficient in docker and js, so I have this file as a dockerfile and there are some instructions,
FROM <company_name>/stratus/app-node:16.13.0 COPY . . # When this Dockerfile is built (with "docker build .") the base "app-node" image will: # - Copy files from this directory into /app on the image # - Run npm install from /app # When resulting image is run (with "docker run"): # - Set $COMPANY_ENVIRONMENT to one of these values test, int, prod (defaults to "dev", set it with "-e COMPANY_ENVIRONMENT=<env>") # - Start the app with "npm start"
so how are supposed to look like commands for this file?
-
@tejaswini docker is creating little virtual machines that can do just about anything. generally, with docker you can compartmentalize what used to be all in one system
into separate containers.web server
database server
application interface (API) serverand then you can use compose to start them, connect them to ‘compose’ a ‘system’ from the parts
but each image can be/is customized to its task…
you don;t need the web stuff on the database server, and vice versa…the dockerfile is the image builders instructions for creating one of these parts.
people/companies have created started images, that do some/most of a function,
that is the from … what do u want to start with
a web server
a database server
an app platform focused on python, java, matlab…an then you tell it where the data is (local inside the container, at some /folder path
or external via some ‘mount’and u can do all kinds of things.
one of the ‘cool’ things is that with a little thought, you can automatically scale the ‘system’ bigger by spinning up another web server or database or whatever…
also, the stuff inside, web server using port 80, doesn’t KNOW that OUTSIDE in the host, it could be port 81, or 9000, or anything. so you can run multiple instances of the container image exactly the same, but different connections …
so, the dockerfile has all the commands to do this kind of setup and launch the ‘one’ app/service the container is supposed to run.
see the syntax for dockerfile (google, or some search engine, is your friend)