Skip to content

Commit

Permalink
Merge pull request #478 from viralsolani/develop
Browse files Browse the repository at this point in the history
Fix Misc Issues
  • Loading branch information
viralsolani authored Oct 1, 2019
2 parents 4b21093 + 51f1f0f commit eb64611
Show file tree
Hide file tree
Showing 27 changed files with 626 additions and 514 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"hieu-le/active": "^3.5",
"laravel/framework": "5.8.*",
"laravel/passport": "^7.2",
"laravel/socialite": "^3.0",
"laravel/socialite": "^4.1",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.4.0",
"spatie/laravel-cors": "^1.2",
Expand Down
594 changes: 320 additions & 274 deletions composer.lock

Large diffs are not rendered by default.

104 changes: 0 additions & 104 deletions deploy/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions deploy/vhost.conf

This file was deleted.

79 changes: 38 additions & 41 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,51 @@
version: '3'
version: "3"

services:
app:
image: inshastri/laravel-adminpanel:latest
image: lap-www
container_name: lap-www
build:
context: ./docker/app
dockerfile: Dockerfile
restart: always
ports:
- 80:80
- 8080:8080
links:
- mysql
- redis
environment:
DB_HOST: mysql
DB_DATABASE: laravel_docker
DB_USERNAME: root
DB_PASSWORD: toor
REDIS_HOST: redis
SESSION_DRIVER: redis
CACHE_DRIVER: redis
networks:
- testservice_bridge2
mysql:
image: mysql:5
volumes:
- ./data:/var/lib/mysql
ports:
- 3306:3306
- .:/var/www/html/
mysql:
container_name: lap-mysql
image: mysql:5.7
restart: always
ports:
- 13306:3306
volumes:
- mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: toor
MYSQL_DATABASE: laravel_docker
networks:
- testservice_bridge2
MYSQL_DATABASE: laravel-admin-panel
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: admin
MYSQL_PASSWORD: admin
redis:
image: redis:4.0-alpine
container_name: lap-redis
image: redis:4-alpine
restart: always
ports:
- 6379:6379
networks:
- testservice_bridge2
- 16379:6379
volumes:
- redis:/data
phpmyadmin:
container_name: lap-phpmyadmin
image: phpmyadmin/phpmyadmin
restart: always
ports:
- 8081:80
links:
- mysql
environment:
PMA_PORT: 3306
PMA_HOST: mysql
PMA_USER: root
PMA_PASSWORD: toor
ports:
- "8005:80"
restart: always
depends_on:
- mysql
networks:
- testservice_bridge2
networks:
testservice_bridge2:

volumes:
mysql:
driver: "local"
redis:
driver: "local"
77 changes: 77 additions & 0 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
FROM php:7.2-apache-stretch

ENV LARAVEL_VERSION 5.8
ENV INSTALL_DIR /var/www/html
ENV COMPOSER_HOME /var/www/.composer/

# Install common tools and libraries
RUN apt-get update && apt-get install -y \
cron \
git \
gzip \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libxslt1-dev \
libmagickwand-dev \
lsof \
mysql-client \
vim \
zip \
unzip \
curl \
openssl \
libssl-dev \
libcurl4-openssl-dev

RUN pecl install imagick-3.4.3

# http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html
RUN docker-php-ext-install bcmath \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& docker-php-ext-install intl \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install opcache \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install zip \
&& docker-php-ext-install xml \
&& docker-php-ext-install ctype \
&& docker-php-ext-install json \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install bz2 \
&& docker-php-ext-install exif

# Install Node, Npm
RUN apt-get install -y gnupg \
&& curl -sL https://deb.nodesource.com/setup_11.x | bash - \
&& apt-get install -y nodejs \
&& mkdir /var/www/.config /var/www/.npm

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Make sure the volume mount point is empty
RUN rm -rf /var/www/html/*

# Set www-data as owner for /var/www
RUN chown -R www-data:www-data /var/www/
RUN chmod -R g+w /var/www/

# add apache modules and configuration
RUN a2enmod rewrite \
&& a2enmod headers \
&& a2enmod expires \
&& echo "memory_limit=2048M" > /usr/local/etc/php/conf.d/memory-limit.ini

# Remove unnecssary modules
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# copy project files
COPY . /var/www/html
COPY vhost.conf /etc/apache2/sites-available/000-default.conf


WORKDIR $INSTALL_DIR
13 changes: 13 additions & 0 deletions docker/app/vhost.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<VirtualHost *:80>
DocumentRoot /var/www/html/public

<Directory /var/www/html/public>
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/www/html/error.log
CustomLog /var/www/html/access.log combined
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
2 changes: 2 additions & 0 deletions docker/bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker/cli bash
3 changes: 3 additions & 0 deletions docker/cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
docker-compose exec app "$@"
3 changes: 3 additions & 0 deletions docker/clinotty
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
docker-compose exec -T app "$@"
2 changes: 2 additions & 0 deletions docker/composer
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker/cli composer "$@"
10 changes: 10 additions & 0 deletions docker/copyfromcontainer
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
[ -z "$1" ] && echo "Please specify a directory or file to copy from container (ex. vendor, --all)" && exit

if [ "$1" == "--all" ]; then
docker cp $(docker-compose ps -q app|awk '{print $1}'):/var/www/html/./ src/
echo "Completed copying all files from container to host"
else
docker cp $(docker-compose ps -q app|awk '{print $1}'):/var/www/html/$1 src/
echo "Completed copying $1 from container to host"
fi
12 changes: 12 additions & 0 deletions docker/copytocontainer
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
[ -z "$1" ] && echo "Please specify a directory or file to copy to container (ex. vendor, --all)" && exit

if [ "$1" == "--all" ]; then
docker cp src/./ $(docker-compose ps -q app|awk '{print $1}'):/var/www/html/
echo "Completed copying all files from host to container"
else
docker cp src/$1 $(docker-compose ps -q app|awk '{print $1}'):/var/www/html/
echo "Completed copying $1 from host to container"
fi

docker/fixowns
3 changes: 3 additions & 0 deletions docker/fixowns
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo "Correcting filesystem ownerships..."
docker/rootnotty chown -R www-data:www-data /var/www/
8 changes: 8 additions & 0 deletions docker/fixperms
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
echo "Correcting filesystem permissions..."

docker/clinotty find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
docker/clinotty find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
docker/clinotty chmod u+x docker/magento

echo "Filesystem permissions corrected."
2 changes: 2 additions & 0 deletions docker/grunt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker/cli node_modules/grunt/bin/grunt "$@"
2 changes: 2 additions & 0 deletions docker/node
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker/cli node "$@"
2 changes: 2 additions & 0 deletions docker/npm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker/cli npm "$@"
3 changes: 3 additions & 0 deletions docker/restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
docker/stop
docker/start
3 changes: 3 additions & 0 deletions docker/rootnotty
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
docker-compose exec -u root -T app "$@"
2 changes: 2 additions & 0 deletions docker/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker-compose -f docker-compose.yml up -d
2 changes: 2 additions & 0 deletions docker/stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker-compose stop
Loading

0 comments on commit eb64611

Please sign in to comment.