Line 16: | Line 16: | ||
docker build . -t localhost:5000/phenixapp | docker build . -t localhost:5000/phenixapp | ||
</code> | </code> | ||
=== Creating the Dockerfile === | === Creating the Dockerfile === | ||
<pre> | <pre> | ||
FROM | FROM phenixapp | ||
ADD /var/www/html /usr/share/nginx/html | ADD /var/www/html /usr/share/nginx/html | ||
VOLUME /var/log/ | VOLUME /var/log/phenixapp/ /var/log/nginx/ | ||
EXPOSE 80 | EXPOSE 80 | ||
ENTRYPOINT [" | ENTRYPOINT ["phenixapp"] | ||
</pre> <br> | </pre> <br> | ||
==== Run the app ==== | |||
<code> | |||
docker run -p 8080:80 --name phenixapp phenixapp | |||
</code> <br> |
Revision as of 22:20, 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