-
Notifications
You must be signed in to change notification settings - Fork 1
Nginx
-
Initial Configuration for NGINX
-
Create the compose file
docker-compose.ymlin the path described below via the terminal:mkdir -p rootInception/srcs/docker-compose.yml
-
Create the docker image configuration file
Dockerfilefor NGINX in the path described below via the terminal:mkdir -p rootInception/srcs/requirements/nginx/Dockerfile
-
Fill in the
docker-compose.ymlso that when executed, it can compose the NGINX container as shown below:version: "3.8" services: nginx: build: requirements/nginx/. container_name: nginx ports: - "80:80"
-
Fill in the
Dockerfilefor NGINX so that it can configure a docker imageFROM debian:bullseye RUN apt update && apt upgrade -y && apt install -y nginx ENTRYPOINT ["nginx", "-g", "daemon off;"]
👉🏼 These are the minimum configurations for NGINX to run inside the container. We now need to test if NGINX is running correctly and if we can access it through the browser on our host/physical machine.
-
Execute the command that will create the NGINX container and start it, as described below, via the terminal:
docker compose up --build
-
Enter the URL
http://127.0.0.1/orhttp://localhostin your preferred browser to test NGINX.👉🏼 Upon confirming the address with ENTER, the browser is expected to display a default NGINX welcome page, confirming that the test passed and that NGINX is now running in the container.
-