Skip to content

DmitriyOT/DevOps-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevOps Example — DevOps Test Task

CI

Русская версия

A simple Python web application with an nginx reverse proxy, deployed in Docker containers using Docker Compose.

Project Structure

.
├── .github/
│   └── workflows/
│       └── ci.yml
├── backend/
│   ├── Dockerfile
│   └── app.py
├── nginx/
│   └── nginx.conf
├── docker-compose.yml
└── README.md

Architecture

User
    │
    ▼
http://localhost:80  (host port)
    │
    nginx (container devops-example-nginx)
    │
    ▼ proxy_pass → http://backend:8080
    backend (container devops-example-backend)
  • backend — a Python HTTP server (http.server), listens on port 8080, reachable only inside the Docker network.
  • nginx — the official nginx image, accepts HTTP requests on port 80 and proxies them to the backend.
  • The services communicate over the internal Docker network devops-example-network via service names.

Requirements

How to Run the Project

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-name>
  2. Build and start the containers:

    docker compose up -d --build
  3. Make sure the containers are running:

    docker compose ps

How to Verify the Result

Send a request to nginx:

curl http://localhost

Expected response:

Hello from DevOps Example!

Stopping and Removing Containers

docker compose down

If you also need to remove the built images:

docker compose down --rmi local

Technologies Used

  • Python 3.12 (official python:3.12-alpine image)
  • nginx 1.27 (official nginx:1.27-alpine image)
  • Docker / Docker Compose
  • GitHub Actions (CI)

CI

On every push to main and on every pull request, a pipeline (.github/workflows/ci.yml) runs that:

  1. Builds the Docker images (docker compose build).
  2. Brings up the whole stack (docker compose up -d).
  3. Runs a smoke test: a request through nginx must return Hello from DevOps Example!.
  4. Verifies that the backend is not reachable from the host directly (only through nginx).

About

Python backend behind an nginx reverse proxy, orchestrated with Docker Compose; CI via GitHub Actions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors