____  ___    _  _     _   _ _____     _______
 / ___|/ _ \  | || |   | | | |_ _\ \   / / ____|
| |  _| | | | | || |_  | |_| || | \ \ / /|  _|
| |_| | |_| | |__   _| |  _  || |  \ V / | |___
 \____|\___/     |_|   |_| |_|___|  \_/  |_____|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

Ngnix Docker setup Guide from scratch: Web 3 development Part 1

BY: @expire0 | CREATED: Dec. 13, 2021, 1:21 a.m. | VOTES: 2 | PAYOUT: $0.02 | [ VOTE ]

[IMAGE: https://images.hive.blog/DQmXwhnCJo7Xo9GPCPi9iZGFPhWHHSGBPuqrgxSKc8cCBMB/image.png]
Background: It’s easy to pull down an existing docker image from https://hub.docker.com/ that has NGINX pre-configured. This article is for those who wish to build their own Nginx docker image. This is the best way to avoid security flaws or running an outdated version of Nginx and the OS. A prime example of this is this docker image that I almost downloaded https://hub.docker.com/r/richarvey/nginx-php-fpm . It hasn’t been updated since 2020.

NGINX is a lightweight web server that can be used for web 3 applications and other applications or websites. So learning how to install and configure Nginx is a great start for anyone new to web 3 development. This will not go into detail about how to install Docker or how to write up a Dockerfile. This will be a two part series which includes installing Nginx, serving some basic content ,installing PHP , and if I can find the time. I will touch on some JavaScript configuration.

Prerequisites: Some basic knowledge of Linux ,vim and Docker containers

OS USED: CentOS Linux release 8.4.2105
Author : Expire0 for https://Expire0.dev

                         Build out the base image

1 Pull down the latest Centos image from the docker. Run the below commands

2 Notice from step one, we named the container “nginx”, This will make it easier to find. Next we’re going to drop into the container and install our base Nginx instance.

3 Installing a Prebuilt CentOS/RHEL Package from the Official NGINX Repository.

Defined yum variables

Add the following lines to nginx.repo.

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/mainline/$osname/$release/$basearch/
gpgcheck=0
enabled=1

run dnf to sync up the new repo

4 Start nginx

curl -I 127.0.0.1
Output 
HTTP/1.1 200 OK
Server: nginx/1.14.1

5 Nginx has been installed and ready to serve some content .Exit out of the container

6 Save the running container as an image.

If you run “docker images”, you will now see your newly created docker image with Nginx installed. The next part We’ll focus on configuring Nginx ,installing PHP and JS. Thanks for reading and stay tune for the next part.

TAGS: [ #Blockchain_Dev ] [ #leofinance ] [ #ethereum ] [ #development ] [ #crypto ] [ #programming ] [ #hivedev ] [ #dev ]

Replies

NO REPLIES FOUND.

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>