Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a558472
feat: Add Docker configuration for `Yii2` application with `Nginx` an…
terabytesoftw Jul 10, 2025
89f49a9
feat: Enhance Nginx supervisord configuration with process management…
terabytesoftw Jul 10, 2025
c6ce9c0
fix: Update Dockerfile and configuration paths for Nginx and Apache s…
terabytesoftw Jul 10, 2025
1141b3f
docs: Clarify comments in Dockerfiles for Apache and Nginx regarding …
terabytesoftw Jul 10, 2025
8b81847
feat: Add SSL configuration for Nginx with enhanced security settings.
terabytesoftw Jul 10, 2025
37acca0
feat: Enhance Docker CI workflow with Docker Compose installation and…
terabytesoftw Jul 10, 2025
13f6535
style: Standardize step names in Docker CI workflow for consistency.
terabytesoftw Jul 10, 2025
feb1e35
feat: Add error log checks for Apache and Nginx containers in CI work…
terabytesoftw Jul 10, 2025
08415d1
fix: Correct docker-compose command syntax for log checks in Apache a…
terabytesoftw Jul 10, 2025
063e4d6
feat: Update Docker CI workflow and configurations for Apache and Ngi…
terabytesoftw Jul 10, 2025
516a216
fix: Remove redundant jobs declaration in Docker CI workflow for Apache.
terabytesoftw Jul 10, 2025
5e5848c
fix: Standardize step names and improve docker-compose installation i…
terabytesoftw Jul 10, 2025
b44c0f2
fix: Update PHPDoc for $tester property and improve assertion for Yii…
terabytesoftw Jul 10, 2025
13a536f
fix: Update Docker CI workflow to run Codeception build and tests for…
terabytesoftw Jul 10, 2025
2c0baad
fix: Refactor Codeception steps in Docker CI workflow for Apache and …
terabytesoftw Jul 10, 2025
c972088
fix: Correct docker-compose command for nginx to improve container bu…
terabytesoftw Jul 10, 2025
989bb6f
fix: Update Dockerfile to correct supervisord config path and improve…
terabytesoftw Jul 10, 2025
f5b000d
fix: Correct docker-compose filename in Nginx CI workflow for consist…
terabytesoftw Jul 10, 2025
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
64 changes: 64 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Docker CI

on:
pull_request:
paths:
- 'docker/**'
- 'docker-compose*.yml'
- '.github/workflows/docker.yml'
push:
paths:
- 'docker/**'
- 'docker-compose*.yml'
- '.github/workflows/docker.yml'

jobs:
test-apache:
runs-on: ubuntu-latest

steps:
- name: Checkout.
uses: actions/checkout@v4

- name: Install docker compose.
run: |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

- name: Build and start containers.
run: docker-compose build --no-cache && docker-compose up -d

- name: Update vendor packages.
run: docker exec yii2-apache composer update --prefer-dist -vvv

- name: Codeceptcion build.
run: docker exec yii2-apache vendor/bin/codecept build

- name: Run codeception tests.
run: docker exec yii2-apache vendor/bin/codecept run

test-nginx:
runs-on: ubuntu-latest

steps:
- name: Checkout.
uses: actions/checkout@v4

- name: Install docker Compose.
run: |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

- name: Build and start containers.
run: docker-compose -f docker-compose.nginx.yml build --no-cache && docker-compose -f docker-compose.nginx.yml up -d

- name: Update vendor packages.
run: docker exec yii2-nginx composer update --prefer-dist -vvv

- name: Codeception build.
run: docker exec yii2-nginx vendor/bin/codecept build

- name: Run codeception build and tests.
run: docker exec yii2-nginx vendor/bin/codecept run
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions docker-compose.nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

services:
yii2-nginx:
build:
dockerfile: docker/nginx/Dockerfile
container_name: yii2-nginx
restart: always
working_dir: /app
volumes:
- ./:/app
- ~/.composer-docker/cache:/root/.composer/cache:delegated
ports:
- '8081:80'
environment:
TZ: "UTC"
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
yii2-apache:
build:
dockerfile: docker/apache/Dockerfile
container_name: yii2-apache
image: yii2-apache:84
restart: always
working_dir: /app
volumes:
- ./:/app
- ~/.composer-docker/cache:/root/.composer/cache:delegated
ports:
- '8080:80'
environment:
TZ: "UTC"
30 changes: 30 additions & 0 deletions docker/apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM yiisoftware/yii2-php:8.4-apache

# change web server config
COPY docker/apache/apache.conf /etc/apache2/apache2.conf
COPY docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf

# change PHP config
COPY docker/php/php.ini /usr/local/etc/php/conf.d/base.ini

# install supervisord and Node.js (includes npm)
RUN apt-get update && apt-get install -y \
supervisor \
curl \
--no-install-recommends \
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# copy supervisord config
COPY docker/apache/supervisord/supervisord.conf /etc/supervisor/supervisord.conf

# copy supervisord program configs
COPY docker/apache/supervisord/conf.d/apache2.conf /etc/supervisor/conf.d/apache2.conf

# copy queue worker config uncommented for use with yii2-queue
#COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf

# run supervisord
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
Loading