-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add Docker configuration for Yii2
application with Nginx
and Apache
setups.
#102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 89f49a9
feat: Enhance Nginx supervisord configuration with process management…
terabytesoftw c6ce9c0
fix: Update Dockerfile and configuration paths for Nginx and Apache s…
terabytesoftw 1141b3f
docs: Clarify comments in Dockerfiles for Apache and Nginx regarding …
terabytesoftw 8b81847
feat: Add SSL configuration for Nginx with enhanced security settings.
terabytesoftw 37acca0
feat: Enhance Docker CI workflow with Docker Compose installation and…
terabytesoftw 13f6535
style: Standardize step names in Docker CI workflow for consistency.
terabytesoftw feb1e35
feat: Add error log checks for Apache and Nginx containers in CI work…
terabytesoftw 08415d1
fix: Correct docker-compose command syntax for log checks in Apache a…
terabytesoftw 063e4d6
feat: Update Docker CI workflow and configurations for Apache and Ngi…
terabytesoftw 516a216
fix: Remove redundant jobs declaration in Docker CI workflow for Apache.
terabytesoftw 5e5848c
fix: Standardize step names and improve docker-compose installation i…
terabytesoftw b44c0f2
fix: Update PHPDoc for $tester property and improve assertion for Yii…
terabytesoftw 13a536f
fix: Update Docker CI workflow to run Codeception build and tests for…
terabytesoftw 2c0baad
fix: Refactor Codeception steps in Docker CI workflow for Apache and …
terabytesoftw c972088
fix: Correct docker-compose command for nginx to improve container bu…
terabytesoftw 989bb6f
fix: Update Dockerfile to correct supervisord config path and improve…
terabytesoftw f5b000d
fix: Correct docker-compose filename in Nginx CI workflow for consist…
terabytesoftw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.