Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'

- name: Validate PHP Syntax
run: php -l index.php

- name: Build Docker Image
run: docker build -t demo-app .
4 changes: 2 additions & 2 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[database]
hostname = mariadb
username = devops
password = devops#2018
password = devopspass
dbname = devopsdemo

[environment]
environment = DEV
environment = local

[prefs]
color = white
Expand Down
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
demo-app:
build: .
container_name: demo-app
ports:
- "8080:80"
depends_on:
- mariadb
environment:
- MYSQL_HOST=mariadb
- MYSQL_USER=devops
- MYSQL_PASSWORD=devopspass
- MYSQL_DATABASE=devopsdemo

mariadb:
image: mariadb:10.5
container_name: mariadb
environment:
- MYSQL_ROOT_PASSWORD=rootpass
- MYSQL_DATABASE=devopsdemo
- MYSQL_USER=devops
- MYSQL_PASSWORD=devopspass
volumes:
- mariadb_data:/var/lib/mysql
ports:
- "3306:3306"

volumes:
mariadb_data:
7 changes: 7 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM php:8.2-apache

RUN docker-php-ext-install mysqli pdo pdo_mysql

COPY . /var/www/html/

EXPOSE 80