Anonymous
×
Create a new article
Write your page title here:
We currently have 27 articles on PhenixOps. Type your article name above or click on one of the titles below and start writing!



PhenixOps
27Articles

Building Containerized Applications: Difference between revisions

(Created page with "== Building a Nginx Server == You can either build from an image or a Dockerfile <br> === Using a Dockerfile === <code> docker build -f /path/Dockerfile </code> <br> ==== Us...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 16: Line 16:
docker build . -t localhost:5000/phenixapp
docker build . -t localhost:5000/phenixapp
</code>
</code>
=== Creating the Dockerfile ===
<pre>
FROM phenixapp
ADD /var/www/html /usr/share/nginx/html
VOLUME /var/log/phenixapp/ /var/log/nginx/
EXPOSE 80
ENTRYPOINT ["phenixapp"]
</pre> <br>


==== Run the app ====
==== Run the app ====
Line 22: Line 31:
</code> <br>
</code> <br>


=== Creating the Dockerfile ===
[[Category:Docker]]
 
<code>
FROM nginx
ADD /var/www/html /usr/share/nginx/html
VOLUME /var/log/nginx/ /var/log/nginx/
EXPOSE 80
ENTRYPOINT ["nginx"]
</code>

Latest revision as of 23:21, 24 April 2020

Building a Nginx Server

You can either build from an image or a Dockerfile

Using a Dockerfile

docker build -f /path/Dockerfile

Using an image from Dockerhub

docker build . -t phenixops/phenixapp

Using an image from pivate registry

docker build . -t localhost:5000/phenixapp

Creating the Dockerfile

FROM phenixapp
ADD /var/www/html /usr/share/nginx/html
VOLUME /var/log/phenixapp/ /var/log/nginx/
EXPOSE 80
ENTRYPOINT ["phenixapp"]


Run the app

docker run -p 8080:80 --name phenixapp phenixapp