Weather Forecast Application

Project Overview

This project is a DevOps implementation of a PHP-based weather forecast application. It demonstrates a complete build and deployment cycle using Docker, Docker Compose, Traefik, and PHP-FPM. The application is orchestrated using GitLab CI, incorporating a custom Docker registry for efficient image management.

Table of Contents

  1. Project Structure
  2. Technologies Used
  3. Setup and Installation
  4. CI/CD Pipeline
  5. Docker Registry
  6. Deployment
  7. Usage
  8. Troubleshooting
  9. Contributing
  10. License

Technologies Used

Setup and Installation

  1. Clone the repository: git clone https://gitlab.com/amialex/go-digital-weather-forecast.git cd go-digital-weather-forecast

  2. Set up environment variables: Create a .env file in the root directory with the following content:

  1. Build and start the containers: docker-compose up -d --build

  2. Access the application at https://scorpiox.io

CI/CD Pipeline

The CI/CD pipeline is defined in .gitlab-ci.yml and consists of three stages:

  1. Build: Builds the Docker image and pushes it to the custom registry.
  2. Test: Runs PHP version checks and executes PHPUnit tests if available.
  3. Deploy: Deploys the application to the production server.

Docker Registry

The project uses GitLab's built-in container registry. The Docker image is built and pushed to the private registry:

registry.gitlab.com/amialex/go-digital-weather-forecast/php-app

Deployment

Deployment is automated through the GitLab CI/CD pipeline. When changes are pushed to the dev branch, the pipeline will:

  1. Build a new Docker image
  2. Run tests
  3. Deploy to the production server

Usage

Troubleshooting