Skip to content

Commit 7e19ea8

Browse files
authored
Merge pull request #11 from joglomedia/linux
v2.0.0 Let It Flow
2 parents c3df56e + ea6d1f1 commit 7e19ea8

File tree

8 files changed

+197
-60
lines changed

8 files changed

+197
-60
lines changed
File renamed without changes.
File renamed without changes.

.github/workflows/main.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: easydock-linux
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches:
10+
- linux
11+
- master
12+
pull_request:
13+
branches:
14+
- master
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
20+
jobs:
21+
# This workflow contains a single job called "build"
22+
build:
23+
# The type of runner that the job will run on
24+
runs-on: ubuntu-latest
25+
26+
# Steps represent a sequence of tasks that will be executed as part of the job
27+
steps:
28+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29+
- uses: actions/checkout@v2
30+
31+
- uses: php-actions/composer@v5
32+
33+
# Runs composer install Laravel for testing
34+
- name: Run composer install Laravel
35+
run: composer create-project laravel/laravel test-app
36+
37+
# Prepare Laravel sample application
38+
#- name: Prepare Laravel application
39+
# run: |
40+
# cd test-app
41+
# php artisan key:generate
42+
43+
# Install test dependencies
44+
- name: Run install testing dependencies
45+
run: |
46+
sudo apt-get update -qq -y
47+
sudo apt-get install -qq -y bash shellcheck
48+
49+
# Shellcheck
50+
- name: Run shellcheck testing
51+
run: shellcheck -s bash -x ./src/easydock
52+
53+
# Simple unit testing
54+
- name: Run unit testing
55+
run: |
56+
cd test-app
57+
bash ../src/easydock init
58+
if [ -f .env.easydock ]; then
59+
echo "Init EasyDock success"
60+
bash ../src/easydock build
61+
bash ../src/easydock up
62+
else
63+
echo "Init EasyDock fail"
64+
exit 1
65+
fi
66+
env:
67+
TERM: xterm-256color

LICENSE

Lines changed: 0 additions & 22 deletions
This file was deleted.

LICENSE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2020 Andrea Pollastri
4+
2021 Edi Septriyanto
5+
6+
> Permission is hereby granted, free of charge, to any person obtaining a copy
7+
> of this software and associated documentation files (the "Software"), to deal
8+
> in the Software without restriction, including without limitation the rights
9+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
> copies of the Software, and to permit persons to whom the Software is
11+
> furnished to do so, subject to the following conditions:
12+
>
13+
> The above copyright notice and this permission notice shall be included in
14+
> all copies or substantial portions of the Software.
15+
>
16+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
> THE SOFTWARE.

README.md

Lines changed: 95 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
# EasyDock for Linux ;)
22

3-
![EasyDock for Linux](ed_275px.png)
4-
3+
<p align="center">
4+
<img src="/.github/assets/ed_275px.png?raw=true" alt="EasyDock Logo © @andreapollastri"/>
5+
</p>
6+
7+
<p align="center">
8+
<a href="https://github.com/joglomedia/easydock-linux/releases"><img src="https://img.shields.io/github/v/tag/joglomedia/easydock-linux?label=version" alt="EasyDock Linux version"></a>
9+
<a href="https://github.com/joglomedia/easydock-linux/network"><img src="https://img.shields.io/github/forks/joglomedia/easydock-linux.svg" alt="GitHub forks"></a>
10+
<a href="https://github.com/joglomedia/easydock-linux/issues"><img src="https://img.shields.io/github/issues/joglomedia/easydock-linux.svg" alt="GitHub issues"></a>
11+
<a href="https://github.com/joglomedia/easydock-linux/stargazers"><img src="https://img.shields.io/github/stars/joglomedia/easydock-linux.svg" alt="GitHub stars"></a>
12+
<a href="https://github.com/joglomedia/easydock-linux/actions/workflows/main.yml"><img src="https://github.com/joglomedia/easydock-linux/actions/workflows/main.yml/badge.svg" alt="GitHub CI"></a>
13+
<a href="https://raw.githubusercontent.com/joglomedia/easydock-linux/master/LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license"></a>
14+
</p>
15+
16+
<p align="center">
517
A fork of EasyDock for Linux. Docker LEMP stack easy integration.
6-
718
Dockerize your PHP apps ;)
8-
9-
![GitHub stars](https://img.shields.io/github/stars/joglomedia/easydock-linux?style=social)
10-
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/joglomedia/easydock-linux?label=version)
19+
</p>
1120

1221
## Features
1322

14-
Easydock comes with:
23+
EasyDock Linux comes with:
1524

1625
- Nginx
1726
- PHP (7.4 and 8.0)
@@ -49,12 +58,20 @@ After installation completed, if required, you could configure your `.env.easydo
4958
easydock build
5059
```
5160

61+
During the build process EasyDock will download required Docker images. Once the build completes, you could _kick-up_ your EasyDock application by executing:
62+
63+
```bash
64+
easydock up
65+
```
66+
5267
### Configure Nginx and PHP-FPM
5368

54-
- The default Nginx server configuration (app.conf) will expose your project `/public` folder.
55-
- If your project uses different directory structure, you should adjust the configuration and update the file accordingly.
69+
- The default Nginx server configuration `app.conf` will expose your project `/public` directory.
70+
- If your project uses different directory structure, you should adjust the configuration in `app.conf` file accordingly.
5671
- Your application by default accessible through localhost on port 8008 (`http://localhost:8008`)
57-
- Supported PHP version: 7.4 & 8.0
72+
- Currently EasyDock-Linux only support stable PHP version; 7.4 & 8.0 from `joglomedia/easydock-php` image.
73+
74+
The Nginx public port and PHP version could be configured inside `.env.easydock` file.
5875

5976
```bash
6077
# APP PORT
@@ -64,15 +81,24 @@ APP_PORT=8008
6481
PHP_VERSION=7.4
6582
```
6683

84+
Everytime you change PHP version into `.env.easydock` file you have to run:
85+
86+
```bash
87+
easydock reset && easydock build
88+
```
89+
90+
_*PS: Resetting your EasyDock instance will delete the database data. You should backup your database before!*_
91+
6792
### Configure database connection
6893

6994
The default database connection for MySQL and PostgreSQL.
7095

7196
```bash
97+
Database: easydockdb
7298
Username: easydock
7399
Password: secret
74-
Database: easydockdb
75-
Host: mysql ( or postgres for PostgreSQL )
100+
Root password: rootsecret
101+
Host name: mysql ( or postgres for PostgreSQL )
76102
```
77103

78104
For security reason, you should change the default database username and password configured in `.env.easydock` file.
@@ -106,66 +132,106 @@ host: mailhog
106132
port: 1025
107133
```
108134

109-
### To start your app instance
135+
## EasyDock Commands
136+
137+
EasyDock comes with handy command line interface to manage your Docker containers. Execute the following commands inside your application directory.
138+
139+
- Initialize EasyDock project.
140+
141+
```bash
142+
easydock init
143+
```
144+
145+
- Build EasyDock images
146+
147+
```bash
148+
easydock build
149+
```
150+
151+
- Start EasyDock application instance
110152

111153
```bash
112154
easydock up
113155
```
114156

115-
### To stop your app instance
157+
- Stop EasyDock application instance
116158

117159
```bash
118160
easydock stop
119161
```
120162

121-
### To restart your app instance
163+
- Restart EasyDock application instance
122164

123165
```bash
124166
easydock restart
125167
```
126168

127-
### To stop and delete your app instance
169+
- Take down (stop and delete) EasyDock instance
128170

129171
```bash
130172
easydock down
131173
```
132174

133-
### To "SSH" into your app instance
175+
- Access `ssh` into EasyDock application instance
134176

135177
```bash
136178
easydock shell
137179
```
138180

139-
### You can get application info using
181+
- Get EasyDock application details
140182

141183
```bash
142184
easydock info
143185
```
144186

145-
### You can reset your running instance
187+
- Hard reset running EasyDock instance
146188

147189
```bash
148190
easydock reset
149191
```
150192

151-
### Everytime you change PHP version into `.env.easydock` file you have to run
193+
## Security Vulnerabilities and Bugs
152194

153-
```bash
154-
easydock reset && easydock build
155-
```
195+
If you discover any security vulnerability or any bug within _EasyDock Linux_, please open an issue.
156196

157-
_*PS: Resetting your EasyDock instance will delete the database data*_
197+
## Awesome People
158198

159-
## Security Vulnerabilities and Bugs
199+
**EasyDock Linux** is an open-source project licensed under the MIT license with its ongoing development made possible entirely by the support of all these smart and generous people, from code contributors to financial contributors. :purple_heart:
160200

161-
If you discover any security vulnerability or any bug within easydock, please open an issue.
201+
Thank you for considering contributing to this project!
162202

163-
## Contributing
203+
### Project Maintainers
164204

165-
Thank you for considering contributing to this project!
205+
<table>
206+
<tbody>
207+
<tr>
208+
<td align="center" valign="top">
209+
<img width="125" height="125" src="https://github.com/joglomedia.png?s=150">
210+
<br>
211+
<strong>Edi Septriyanto</strong>
212+
<br>
213+
<a href="https://github.com/joglomedia">@joglomedia</a>
214+
</td>
215+
</tr>
216+
</tbody>
217+
</table>
218+
219+
### Code Contributors
220+
221+
<a href="https://github.com/joglomedia/easydock-linux/graphs/contributors">
222+
<img src="https://contrib.rocks/image?repo=joglomedia/easydock-linux" />
223+
</a>
224+
225+
Made with [contributors-img](https://contrib.rocks).
226+
227+
### Financial Contributors
228+
229+
You can support us using any of the methods below:
230+
231+
**[Buy Me a Bottle of Milk or a Cup of Coffee](https://paypal.me/masedi) !!**
166232

167233
## Licence
168234

169-
Easydock is open-source software licensed under the MIT license.
235+
EasyDock Linux is open-source project licensed under the MIT license.
170236

171237
### Enjoy easydock ;)

src/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ RUN apk update && apk upgrade \
6161
pgsql \
6262
redis \
6363
soap \
64+
swoole \
6465
xsl \
6566
zip \
6667
# Install composer

src/easydock

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function ed_logo() {
103103
function ed_check_dependencies() {
104104
local PCKGS=''
105105

106-
for cmd in "certutil" "docker" "docker-compose"; do
106+
for cmd in "docker" "docker-compose"; do
107107
local str=''
108108

109109
if ! [[ -x "$(command -v ${cmd})" ]]; then
@@ -317,23 +317,24 @@ function ed_help() {
317317
}
318318

319319
function ed_info() {
320-
echo -e "${bgpurple}${white}${bold} easydock System Information ${reset}${br}"
320+
echo -e "${bgpurple}${white}${bold} EasyDock System Information ${reset}${br}"
321321
echo "${bold}Application${reset}"
322322
echo "Name: ${ed_appsid}"
323323
echo "Path: ${ed_appsrc}"
324-
echo "Document Root: /var/www/public"
324+
echo "Document Root: /var/www"
325325
echo "Index File: index.php"
326326
if [ "${ed_portapp}" == "80" ]; then
327327
echo "Host: http://localhost"
328328
else
329329
echo "Host: http://localhost:${ed_portapp}"
330330
fi
331331
echo -e "Stack: php:${ed_phpver} + mariadb:latest + nginx:latest ${br}"
332-
echo "${bold}MySQL${reset}"
333-
echo "Host: mysql:${ed_portdb} (int) / 127.0.0.1:${ed_portdb} (ext)"
334-
echo "Name: ${ed_dbname}"
335-
echo "User: root"
336-
echo -e "Pass: ${ed_dbpass} ${br}"
332+
echo "${bold}MySQL / PostgreSQL${reset}"
333+
echo "MySQL Host: mysql:${ed_portmysql} (int) / 127.0.0.1:${ed_portmysql} (ext)"
334+
echo "PostgreSQL Host: postgres:${ed_portpgsql} (int) / 127.0.0.1:${ed_portpgsql} (ext)"
335+
echo "DB Name: ${ed_dbname}"
336+
echo "Username: ${ed_dbuser}"
337+
echo -e "Password: ${ed_dbpass} ${br}"
337338
echo "${bold}SMTP${reset}"
338339
echo "Host: mailhog"
339340
echo "Port: 1025"
@@ -553,7 +554,7 @@ function ed_cli_menu() {
553554
*)
554555
shift
555556
ed_notfound "${menu}"
556-
exit -1
557+
exit 1
557558
;;
558559
esac
559560
shift
@@ -602,7 +603,9 @@ function ed_bootstrap() {
602603
ed_phpver=$(grep PHP_V .env.easydock | cut -d '=' -f2)
603604
#ed_dbver=$(grep DB_VERS .env.easydock | cut -d '=' -f2)
604605
ed_dbname=$(grep DB_NAME .env.easydock | cut -d '=' -f2)
606+
ed_dbuser=$(grep DB_USER .env.easydock | cut -d '=' -f2)
605607
ed_dbpass=$(grep DB_PASS .env.easydock | cut -d '=' -f2)
608+
#ed_dbrootpass=$(grep DB_ROOT_PASS .env.easydock | cut -d '=' -f2)
606609
#ed_nginx=$(grep NGINX_MODE .env.easydock | cut -d '=' -f2)
607610

608611
# Execute CLI command.

0 commit comments

Comments
 (0)