-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.9.0 - first Dockerised version, start of push towards 1.0 r…
…elease.
- Loading branch information
Showing
10 changed files
with
201 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*~ # Text editor backup files | ||
.dockerignore # This file | ||
.git # Git data | ||
.gitignore # Git ignore file | ||
bin/dev-tools # Utility scripts for CMS development | ||
Dockerfile # Docker build instructions | ||
docs/ # More documentation | ||
README # Documentation | ||
t/ # Tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
FROM debian:jessie | ||
MAINTAINER Denny de la Haye <[email protected]> | ||
|
||
|
||
# Set some general config stuff | ||
|
||
ENV APP_NAME=ShinyCMS \ | ||
APP_PORT=6174 \ | ||
APP_USER=shinycms \ | ||
APP_DIR=/opt/shinycms \ | ||
SHINYCMS_CONFIG=/opt/shinycms/config/shinycms.conf | ||
|
||
|
||
# Install required Debian packages | ||
|
||
RUN apt-get update \ | ||
\ | ||
&& apt-get install -y \ | ||
cpanminus \ | ||
gcc \ | ||
libexpat-dev `# Required by XML::Parser for XML::Feed` \ | ||
libmysqlclient-dev `# Required by DBD::mysql` \ | ||
libpq-dev `# Required by DBD::Pg` \ | ||
libxml2-dev `# Required by XML::LibXML for XML::Feed` \ | ||
make \ | ||
zlib1g-dev `# Required by XML::LibXML for XML::Feed` \ | ||
\ | ||
&& apt-get clean \ | ||
\ | ||
&& rm -rf /var/cache/apt/archives/* | ||
|
||
|
||
# Install required CPAN modules | ||
|
||
RUN cpanm --notest \ | ||
parent \ | ||
Captcha::reCAPTCHA \ | ||
Catalyst::Action::RenderView \ | ||
Catalyst::Authentication::Realm::SimpleDB \ | ||
Catalyst::Plugin::Authentication \ | ||
Catalyst::Plugin::ConfigLoader \ | ||
Catalyst::Plugin::Session \ | ||
Catalyst::Plugin::Session::State::Cookie \ | ||
Catalyst::Plugin::Session::Store::DBIC \ | ||
Catalyst::Plugin::Static::Simple \ | ||
Catalyst::Runtime \ | ||
Catalyst::TraitFor::Request::BrowserDetect \ | ||
Catalyst::View::TT \ | ||
Catalyst::View::Email \ | ||
CatalystX::RoleApplicator \ | ||
Config::General \ | ||
DBD::mysql \ | ||
DBD::Pg \ | ||
DBIx::Class::EncodedColumn \ | ||
DBIx::Class::Schema::Loader \ | ||
DBIx::Class::TimeStamp \ | ||
Email::Sender \ | ||
Email::Valid \ | ||
FCGI \ | ||
FCGI::ProcManager \ | ||
File::Pid \ | ||
HTML::Restrict \ | ||
HTML::TagCloud \ | ||
HTML::TreeBuilder \ | ||
Method::Signatures::Simple \ | ||
Module::Install::Catalyst \ | ||
MooseX::NonMoose \ | ||
MooseX::MarkAsMethods \ | ||
Net::Domain::TLD \ | ||
Text::CSV::Simple \ | ||
Template::Plugin::Markdown \ | ||
URI::Encode \ | ||
XML::Feed \ | ||
\ | ||
&& rm -rf /root/.cpan /root/.cpanm | ||
|
||
|
||
# Copy the webapp files into place and make sure our webapp user owns them | ||
|
||
RUN mkdir $APP_DIR | ||
|
||
COPY . $APP_DIR | ||
|
||
RUN groupadd -r $APP_USER && useradd -r -g $APP_USER $APP_USER | ||
|
||
RUN chown -R $APP_USER.$APP_USER $APP_DIR | ||
|
||
|
||
# Run the webapp! | ||
|
||
EXPOSE $APP_PORT | ||
|
||
WORKDIR $APP_DIR | ||
|
||
USER $APP_USER | ||
|
||
CMD script/shinycms_server.pl --port 6174 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
docker build -t shinyideas/shinycms . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
source 'script.config' | ||
|
||
docker run -it \ | ||
--link ShinySQL_$DOMAIN:mysql \ | ||
--rm mysql sh -c 'exec mysql \ | ||
-h"$MYSQL_PORT_3306_TCP_ADDR" \ | ||
-P"$MYSQL_PORT_3306_TCP_PORT" \ | ||
-uroot \ | ||
-p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD" \ | ||
shinycms' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
source 'script.config' | ||
|
||
docker run -d \ | ||
--name ShinySQL_$DOMAIN \ | ||
-e MYSQL_USER=$DB_USER \ | ||
-e MYSQL_PASSWORD=$DB_PASS \ | ||
-e MYSQL_DATABASE=shinycms \ | ||
-e MYSQL_ROOT_PASSWORD=$ROOT_PASS \ | ||
--volume $BASE_DIR/$DOMAIN/MySQL/data:/var/lib/mysql \ | ||
--volume $BASE_DIR/$DOMAIN/MySQL/conf:/etc/mysql/conf.d \ | ||
mysql:$MYSQL_VERSION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Domain name of the website | ||
DOMAIN=shiny.cms | ||
|
||
# Directory the site data directory will be stored in | ||
BASE_DIR=/home/sites | ||
|
||
# Port on the host machine that you want the site on | ||
PORT=6174 | ||
|
||
# How many Starman worker processes to spawn initially | ||
WORKERS=5 | ||
|
||
# Site database username and password | ||
DB_USER=shinyuser | ||
DB_PASS=shinypass | ||
|
||
# Database root password | ||
ROOT_PASS=changeme | ||
|
||
# Which MySQL version to run (5.5 / 5.6 / 5.7 / latest) | ||
MYSQL_VERSION=5.7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source 'script.config' | ||
|
||
docker exec -it ShinyCMS_$DOMAIN /bin/bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
source 'script.config' | ||
|
||
docker run -d \ | ||
--name ShinyCMS_$DOMAIN \ | ||
--publish $PORT:6174 \ | ||
--link ShinySQL_$DOMAIN:mysql \ | ||
--volume $BASE_DIR/$DOMAIN/ShinyCMS/config:/opt/shinycms/config:ro \ | ||
--volume $BASE_DIR/$DOMAIN/ShinyCMS/site/templates:/opt/shinycms/root:rw \ | ||
--volume $BASE_DIR/$DOMAIN/ShinyCMS/site/assets:/opt/shinycms/root/static:rw \ | ||
--volume $BASE_DIR/$DOMAIN/ShinyCMS/site/restricted-files:/opt/shinycms/root/restricted-files:ro \ | ||
--volume $BASE_DIR/$DOMAIN/ShinyCMS/admin/templates:/opt/shinycms/root/admin:ro \ | ||
--volume $BASE_DIR/$DOMAIN/ShinyCMS/admin/assets/images:/opt/shinycms/root/static/images/admin:ro \ | ||
shinyideas/shinycms \ | ||
starman script/shinycms_plack.psgi --listen :$PORT --workers $WORKERS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters