Skip to content

Commit 92215ee

Browse files
authored
Merge pull request #1 from kohanaxworld/travis-devel
Add Init ubuntu:24.04 (PHP 7.3 + PHP 8.3) redis-server + memcached
2 parents 8712cbe + d616664 commit 92215ee

4 files changed

Lines changed: 236 additions & 2 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: GitHub Actions Demo
2+
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
3+
on: [push]
4+
jobs:
5+
Explore-GitHub-Actions:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
9+
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
10+
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
11+
- name: Check out repository code
12+
uses: actions/checkout@v4
13+
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
14+
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
15+
- name: List files in the repository
16+
run: |
17+
ls ${{ github.workspace }}
18+
- run: echo "🍏 This job's status is ${{ job.status }}."

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
FROM ubuntu:24.04
2+
MAINTAINER "Kohana World Team"
3+
4+
# noninteractive to prevent user input forms
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
7+
ARG TZ=Etc/UTC
8+
9+
# Set ENV treavis_test to 1 (true) - This can be used inside Unittests to detrmine the env
10+
ENV TRAVIS_TEST=1;
11+
12+
# Install Required Packages
13+
# First add 'deb-src' so we can 'build-dep'
14+
# Update an upgrade system
15+
# Install (without recommends and silent) basic system tools and required libs
16+
# Add PHP 7.3 repository and install php7.3 with all required extensions
17+
# Finally: install composer and configure services
18+
RUN cp /etc/apt/sources.list /etc/apt/sources.list~ && \
19+
sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list && \
20+
apt-get update && \
21+
apt-get -qq install --no-install-recommends apt-utils software-properties-common htop nano && \
22+
add-apt-repository ppa:ondrej/php && \
23+
apt-get update && \
24+
apt-get -qq upgrade && \
25+
apt-get -qq install ca-certificates \
26+
language-pack-en \
27+
curl \
28+
unzip \
29+
wget \
30+
gcc \
31+
git \
32+
libcurl4-openssl-dev \
33+
libde265-dev \
34+
libwebp-dev \
35+
libmagic-dev \
36+
libmcrypt-dev \
37+
libmemcached11 \
38+
libmemcachedutil2 \
39+
libmemcached-dev \
40+
libmagickwand-dev \
41+
zlib1g-dev \
42+
zlib1g \
43+
imagemagick \
44+
webp \
45+
tzdata && \
46+
apt-get -qq install --no-install-recommends \
47+
redis-server \
48+
memcached \
49+
php-dev \
50+
php-pear && \
51+
echo "requirepass password" >> /etc/redis/redis.conf && \
52+
sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf && \
53+
pear update-channels && \
54+
pecl upgrade timezonedb && \
55+
apt-get -qq install --no-install-recommends \
56+
php7.3-dev \
57+
php7.3 \
58+
php7.3-apcu \
59+
php7.3-common \
60+
php7.3-cli \
61+
php7.3-mbstring \
62+
php7.3-gd \
63+
php7.3-mysql \
64+
php7.3-curl \
65+
php7.3-xml \
66+
php7.3-sqlite3 \
67+
php7.3-opcache \
68+
php7.3-pgsql \
69+
php7.3-mysql \
70+
php7.3-intl \
71+
php7.3-raphf \
72+
php7.3-mcrypt \
73+
php7.3-apcu \
74+
php7.3-gmagick \
75+
php7.3-mcrypt \
76+
php7.3-propro \
77+
php7.3-redis && \
78+
update-alternatives --set php /usr/bin/php7.3 && \
79+
update-alternatives --set phpize /usr/bin/phpize7.3 && \
80+
update-alternatives --set php-config /usr/bin/php-config7.3 && \
81+
printf "\n" | pecl install memcache-4.0.5.2 && \
82+
echo 'extension=memcache.so' >> /etc/php/7.3/cli/php.ini && \
83+
echo 'apc.enabled=1' >> /etc/php/7.3/cli/php.ini && \
84+
echo 'apc.enable_cli=1' >> /etc/php/7.3/cli/php.ini && \
85+
echo "\n" | pecl install xdebug-3.1.6 && \
86+
echo 'zend_extension=/usr/lib/php/20180731/xdebug.so' >> /etc/php/7.3/cli/php.ini && \
87+
echo 'xdebug.mode = coverage ' >> /etc/php/7.3/cli/php.ini && \
88+
apt-get -qq install --no-install-recommends \
89+
php-curl \
90+
php-xdebug \
91+
php-redis \
92+
php-pear \
93+
php-yaml \
94+
php-gd \
95+
php-http \
96+
php-raphf \
97+
php-mcrypt \
98+
php-mbstring \
99+
php-memcache \
100+
php-sqlite3 \
101+
php-mysql \
102+
php-pgsql \
103+
php-apcu \
104+
php-gmagick && \
105+
echo 'xdebug.mode = coverage ' >> /etc/php/8.3/cli/php.ini && \
106+
echo 'apc.enabled=1' >> /etc/php/8.3/cli/php.ini && \
107+
echo 'apc.enable_cli=1' >> /etc/php/8.3/cli/php.ini && \
108+
apt-get -qq remove gcc php-dev php7.3-dev && \
109+
echo 'Y' | apt -qq autoremove && \
110+
rm -rf /var/lib/apt/lists/*
111+
112+
RUN curl -s https://getcomposer.org/installer | php && \
113+
mv composer.phar /usr/local/bin/composer && \
114+
mkdir -p /tmp/kohana

README.md

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,96 @@
1-
# docker
2-
Kohana Docker Images ( kohana.world, koseven, modseven)
1+
# Kohana.World Docker Images ( kohana.world, koseven, modseven)
2+
![License](https://img.shields.io/badge/license-BSD--3--Clause-green.svg)
3+
4+
This repository holds docker images which can be used for Kohana Framework.
5+
6+
There will be 4 branches which all server a different purpose:
7+
8+
| Branch | Purpose |
9+
| --------------- |---------------------------------------------------------------------------------------------|
10+
| master | Image for a development/production environment. |
11+
| travis | Image for Unit-Testing inside Travis CI (CAREFUL: Don't use on production servers.) |
12+
| devel | Development Branch for `master`. Only latest `kohana:devel` version will be supproted. |
13+
| travis-devel | Development Branch for `travis`. Only latest `kohana:devel` version will be supproted. |
14+
15+
## Using the container images
16+
17+
Using one of the container is quite straight forward.
18+
The docker repository for them is called `kohanaworld/docker`.
19+
20+
By specifying the desired branch as docker-tag you can acquire the desired image.
21+
22+
_Note: for pulling the `master` branch use `latest` as tag name._
23+
24+
e.g. This will pull the master branch image:
25+
`docker pull kohanaworld/docker:latest`
26+
27+
e.g This will pull the travis branch image:
28+
`docker pull kohanaworld/docker:travis-devel`
29+
30+
After executing the `docker pull` command from above you're done setting up
31+
your docker image, now you can go ahead and use it!
32+
33+
## Example for using `master` image
34+
35+
__Coming Soon. Stay tuned!__
36+
37+
## Example for using `travis-devel` image
38+
39+
For this particular Image you have multiple options.
40+
41+
1. Some IDE's ([PHPStorm](https://intellij-support.jetbrains.com/hc/en-us/community/posts/14391537025170-PHPUnittests-via-docker-by-PHPStorm-Configuration) for example) have full support for docker unittesting, you just need to configure it there and
42+
you are good to go!
43+
44+
2. Run the tests from the cli. Execute the following cli commands (from within your Kohana installation folder):
45+
Start container in background and mount installation folder:
46+
47+
```shell
48+
docker stop unittest && docker rm unittest
49+
docker run -dtP --name unittest -v $(pwd):/tmp/kohana/ kohanaworld/docker:travis-devel
50+
```
51+
52+
3. Start services, install composer requirements and run PHPUnit
53+
```shell
54+
docker exec unittest /bin/sh -c "service redis-server start; service memcached start"
55+
cd /tmp/kohana
56+
update-alternatives --config php
57+
# switch php version
58+
composer install
59+
php vendor/bin/phpunit"
60+
```
61+
62+
_(Hint) You can execute a `/bin/bash` shell inside the container and modify it before Unit-Testing
63+
```shell
64+
docker exec -it unittest /bin/bash
65+
cd /tmp/kohana
66+
```
67+
_(Hint) You can execute a single test
68+
```shell
69+
docker exec -it unittest /bin/bash
70+
cd /tmp/kohana
71+
composer install
72+
php vendor/bin/phpunit --filter HTMLTest
73+
php vendor/bin/phpunit --filter HTMLTest --debug
74+
```
75+
_
76+
77+
For more examples / tutorials how to create and interact with container visit the official [Docker Help](https://docs.docker.com/get-started/)
78+
79+
## Roadmap
80+
81+
| Target | Release date |
82+
| ---------------------- |--------------|
83+
| Initial `master` image | 2024.07.01 |
84+
| Initial `travis` image | 2024.06.16 |
85+
| Initial `travis-devel` | 2024.06.09 |
86+
87+
## Contributing
88+
89+
As usual, [fork and send pull requests](https://github.com/kohanaxworld/docker/pulls)
90+
91+
## Getting Help
92+
93+
* Open issues in this project.
94+
95+
## TODO
96+

0 commit comments

Comments
 (0)