https://github.com/surya-v-28/docker-images
https://github.com/surya-v-28/docker-images
docker docker-compose docker-image dockerfile
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/surya-v-28/docker-images
- Owner: Surya-V-28
- Created: 2024-10-08T03:57:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-05T13:50:23.000Z (over 1 year ago)
- Last Synced: 2025-02-05T14:36:12.122Z (over 1 year ago)
- Topics: docker, docker-compose, docker-image, dockerfile
- Language: CSS
- Homepage: https://hub.docker.com/repositories/surya28v
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Static Web App Containerization with Nginx
This project demonstrates how to containerize a simple static web application (HTML, CSS, and JavaScript) using Nginx in a Docker container.
## Table of Contents
- [Prerequisites](#prerequisites)
- [Project Structure](#project-structure)
- [Docker Setup](#docker-setup)
- [Nginx Configuration](#nginx-configuration)
- [Building and Running the Container](#building-and-running-the-container)
- [Accessing the Web App](#accessing-the-web-app)
- [Stopping the Container](#stopping-the-container)
## Prerequisites
Before starting, ensure you have the following installed:
- [Docker](https://www.docker.com/get-started) (version 20.10 or higher)
- Basic knowledge of HTML, CSS, JavaScript, and Docker
```
# Stage 1: Build stage
FROM nginx:alpine
# Copy the Nginx configuration file
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
# Copy the static web app files
COPY ./public /usr/share/nginx/html
# Expose port 80 to access the application
EXPOSE 80
# Start Nginx when the container starts
CMD ["nginx", "-g", "daemon off;"]
```
this should be the dockerfile content
---