Skip to content

Commit

Permalink
Merge pull request #8 from joglomedia/linux
Browse files Browse the repository at this point in the history
Re-configuration
  • Loading branch information
joglomedia authored May 30, 2021
2 parents c491ef0 + 66509fe commit 5ee4cf9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
3 changes: 3 additions & 0 deletions config/.env.easydock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ APP_PORT=8008
# PHP VERSION
PHP_VERSION=8.0

# Nodejs Version
NODE_VERSION=12.18.4

# MYSQL DB NAME
DB_NAME=easydockdb

Expand Down
3 changes: 2 additions & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Dockerfile Args
ARG PHP_VERSION
ARG NODE_VERSION

# Use PHP image
FROM php:${PHP_VERSION}-fpm-alpine
Expand Down Expand Up @@ -65,7 +66,7 @@ RUN apk update && apk upgrade \
# Install composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
# Install node & npm (not yet required for php application)
&& apk add --no-cache nodejs npm yarn \
&& apk add --update nodejs=${NODE_VERSION} npm yarn \
# Add user
&& set -eux; \
addgroup -g 1000 -S www; \
Expand Down
14 changes: 6 additions & 8 deletions src/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
version: '3'
services:
version: '3.7'

services:
# Application
app:
build:
context: .
dockerfile: ${APP_DIR}/.easydock/Dockerfile
args:
- PHP_VERSION=${PHP_VERSION}
- NODE_VERSION=${NODE_VERSION}
- APP_WORKER=${APP_WORKER}
container_name: ${APP_SID}-app
restart: always
Expand All @@ -25,6 +26,7 @@ services:
image: nginx:alpine
container_name: ${APP_SID}-nginx
restart: always
tty: true
ports:
- ${APP_PORT}:80
volumes:
Expand All @@ -37,13 +39,12 @@ services:
image: yobasystems/alpine-mariadb:latest
container_name: ${APP_SID}-mysql
restart: always
tty: true
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASS}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
expose:
- 3306
ports:
- ${DB_PORT}:3306
command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci','--default-authentication-plugin=mysql_native_password']
Expand All @@ -55,10 +56,9 @@ services:
image: redis:alpine
container_name: ${APP_SID}-redis
restart: always
tty: true
environment:
REDIS_PASSWORD: ${REDIS_PASS}
expose:
- 6379
ports:
- ${REDIS_PORT}:6379

Expand Down Expand Up @@ -89,7 +89,5 @@ services:
image: mailhog/mailhog:latest
container_name: ${APP_SID}-mailhog
restart: always
expose:
- 1025
ports:
- ${MH_PORT}:8025
17 changes: 15 additions & 2 deletions src/easydock
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# | Authors : Edi Septriyanto <[email protected]> |
# | Andrea Pollastri <[email protected]> |
# | Min. requirement : GNU/Linux Debian 8, Ubuntu 16.04 or Linux Mint 17 |
# | Version : 1.0.3 |
# | Last Update : 14/04/2021 |
# | Version : 1.0.4 |
# | Last Update : 31/05/2021 |
# +-------------------------------------------------------------------------+
# | EasyDock-Linux Copyright (c) 2021 MasEDI.Net |
# | EasyDock's Logo & Name Copyright (c) Andrea Pollastri |
Expand Down Expand Up @@ -451,6 +451,14 @@ function ed_conn() {
ed_shell
}

function ed_sql_shell() {
echo -e "${blue}Wait... ${reset}${br}"
sleep 1s
echo -e "${bgblue}${white} Database Shell ${reset}${br}"
echo -e "Run ${bgwhite}${black} exit ${reset} to return on your Linux shell.${br}"
docker-compose -f ./.easydock/docker-compose.yml --env-file=./.env.easydock exec mysql /bin/bash
}

############################################################ CLI MENU

function ed_cli_menu() {
Expand Down Expand Up @@ -521,6 +529,11 @@ function ed_cli_menu() {
ed_shell
exit
;;
sql_shell)
shift
ed_sql_shell
exit
;;
*)
shift
ed_notfound "${menu}"
Expand Down

0 comments on commit 5ee4cf9

Please sign in to comment.