Skip to content

Commit

Permalink
Merge pull request #3 from imonroe/dockerize
Browse files Browse the repository at this point in the history
Dockerize
  • Loading branch information
imonroe authored Nov 22, 2019
2 parents 99498d0 + f92e049 commit da90d9a
Show file tree
Hide file tree
Showing 514 changed files with 229,520 additions and 3,648 deletions.
10 changes: 10 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
COMPOSE_PROJECT_NAME=Coldreader

MASTER_DB_PORT=3306
MASTER_DB_DATABASE=homestead
MASTER_DB_USERNAME=homestead
MASTER_DB_PASSWORD=secret
MASTER_MYSQL_ROOT_PASSWORD=Pro@123

MASTER_REDIS_PASSWORD=null
MASTER_REDIS_PORT=6379
18 changes: 2 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.env.dusk.local
.env*
/.env.BAK
dbdata/mysql/*
dbdata/postgres/*
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All Notable changes to Coldreader will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 2.3.1 - 2019-11-22
- Breaking changes since 2.2.1: Dockerized the application, changes to the folder structure, added support for CapRover deployments

## 2.2.1 - 2018-04-22
- Breaking changes since 2.1.1. Method signatures have changed for the Aspect type in the CRPS package, and I updated the basic aspect types to reflect it.

Expand Down
66 changes: 66 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM php:7.2-fpm

# Set working directory
WORKDIR /var/www

# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
mariadb-client \
libpng-dev \
libpq-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
nano \
unzip \
git \
curl \
dos2unix \
cron \
procps \
nginx

# install nodejs
RUN curl sL https://deb.nodesource.com/setup_10.x | bash
RUN apt-get install --yes nodejs && node -v && npm -v

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install extensions
RUN docker-php-ext-install pdo_mysql pdo_pgsql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install gd

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

# Add user for laravel application
RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www

# Copy existing application directory and supporting files.
COPY ./application /var/www/
COPY ./configuration/nginx/conf.d/ /etc/nginx/conf.d/
COPY ./configuration/php/local.ini /usr/local/etc/php/conf.d/local.ini

RUN rm -rf /etc/nginx/sites-enabled && mkdir -p /etc/nginx/sites-enabled && chmod -R 777 /var/www/storage

RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

# Copy in our helper scripts
COPY wait-for-it.sh /
COPY docker-entry.sh /

# fix scripts
RUN dos2unix /*.sh && chmod +x /docker-entry.sh && chmod +x /wait-for-it.sh

# Expose port 80 and start php-fpm server
EXPOSE 80

CMD ["/docker-entry.sh"]

4 changes: 3 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Coldreader
Copyright (C) 2017-2018 Ian Monroe

Copyright (C) 2017-2019 Ian Monroe


This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
18 changes: 3 additions & 15 deletions .env.example → application/.env.example
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
APP_NAME=Laravel
APP_ENV=local

APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
CACHE_DRIVER=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions application/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.env.dusk.local
/.env.BAK
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions app/CustomAspects.php → application/app/CustomAspects.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use imonroe\crps\AspectFactory;
use imonroe\crps\Subject;
use imonroe\crps\Ana;
use League\CommonMark\CommonMarkConverter;
use Validator;

class DefaultAspect extends Aspect{
Expand Down Expand Up @@ -76,17 +75,3 @@ public function pre_delete(Request &$request)
}

}



// --------- Begin Custom Aspects -------------- //

/* -- Basic Aspect Types -- */

/* -- Begin App-specific Aspects -- */


// ---------------------------------------------- //


// ---------- End Custom Aspects ---------------- //
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions composer.json → application/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@
"spatie/laravel-medialibrary": "^6.0.0",
"watson/bootstrap-form": "^1.1",
"fabpot/goutte": "^3.2",
"imonroe/cr_basic_aspects": "dev-master"
"imonroe/cr_basic_aspects": "dev-master",
"predis/predis": "^1.1"
},
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
"phpunit/phpunit": "^7.0",
"barryvdh/laravel-debugbar": "^3.2",
"jeroen-g/laravel-packager": "^2.2",
"squizlabs/php_codesniffer": "*"
},
"autoload": {
"classmap": [
Expand Down
Loading

0 comments on commit da90d9a

Please sign in to comment.