Skip to content

Commit dd0a74b

Browse files
committed
New Docker Container
1 parent 027636f commit dd0a74b

File tree

7 files changed

+68
-10
lines changed

7 files changed

+68
-10
lines changed

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM php:7.1-apache
2+
MAINTAINER Devin Matte <[email protected]>
3+
4+
EXPOSE 8080
5+
EXPOSE 8443
6+
7+
RUN a2enmod rewrite && a2enmod headers && a2enmod expires
8+
9+
RUN sed -i '/Listen/{s/\([0-9]\+\)/8080/; :a;n; ba}' /etc/apache2/ports.conf
10+
11+
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf
12+
13+
RUN apt-get -yq update && \
14+
apt-get -yq install gnupg libmagickwand-dev --no-install-recommends
15+
16+
RUN docker-php-ext-install mysqli
17+
RUN pecl install imagick && docker-php-ext-enable imagick
18+
19+
COPY . /var/www/html
20+
21+
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
22+
apt-get -yq update && \
23+
apt-get -yq install nodejs && \
24+
npm install && \
25+
npm run-script build && \
26+
rm -rf node_modules && \
27+
apt-get -yq remove nodejs npm && \
28+
apt-get -yq clean all
29+
30+
RUN chmod og+rwx /var/lock/apache2 && chmod -R og+rwx /var/run/apache2

apache-config.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<VirtualHost *:8080>
2+
ServerAdmin [email protected]
3+
DocumentRoot /var/www/html
4+
5+
<Directory /var/www/html/>
6+
Options Indexes FollowSymLinks MultiViews
7+
AllowOverride All
8+
Order deny,allow
9+
Allow from all
10+
</Directory>
11+
12+
ErrorLog ${APACHE_LOG_DIR}/error.log
13+
CustomLog ${APACHE_LOG_DIR}/access.log combined
14+
15+
</VirtualHost>

api/entity.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
////////////////////////////////////////////////////////////////////////////
1111

1212
// REQUIRED FILES //////////////////////////////////////////////////////////
13-
require_once "../inc/config.php";
13+
if (file_exists('../inc/config.php')) {
14+
require_once "../inc/config.php";
15+
} else {
16+
require_once "../inc/config.env.php";
17+
}
1418
require_once "../inc/databaseConn.php";
1519
require_once "../inc/timeFunctions.php";
1620
require_once "../inc/ajaxError.php";

api/generate.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
////////////////////////////////////////////////////////////////////////////
1111

1212
// REQUIRED FILES
13-
require_once "../inc/config.php";
13+
if (file_exists('../inc/config.php')) {
14+
require_once "../inc/config.php";
15+
} else {
16+
require_once "../inc/config.env.php";
17+
}
1418
require_once "../inc/databaseConn.php";
1519
require_once "../inc/timeFunctions.php";
1620
require_once "../inc/ajaxError.php";

api/schedule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
////////////////////////////////////////////////////////////////////////////
1010

1111
// REQUIRED FILES //////////////////////////////////////////////////////////
12-
require_once('../inc/config.php');
12+
if (file_exists('../inc/config.php')) {
13+
require_once "../inc/config.php";
14+
} else {
15+
require_once "../inc/config.env.php";
16+
}
1317
require_once('../inc/databaseConn.php');
1418
require_once('../inc/timeFunctions.php');
1519

api/search.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ function assertNumeric($var, $name) {
2525
}
2626

2727
// REQUIRED FILES //////////////////////////////////////////////////////////
28-
require_once "../inc/config.php";
28+
if (file_exists('../inc/config.php')) {
29+
require_once "../inc/config.php";
30+
} else {
31+
require_once "../inc/config.env.php";
32+
}
2933
require_once "../inc/databaseConn.php";
3034
require_once "../inc/timeFunctions.php";
3135
require_once "../inc/ajaxError.php";

inc/config.env.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
$COOKIE_STORE = $get_env(getenv("COOKIE_STORE"), '/tmp/siscookies.txt');
1111
$DATABASE_SERVER = $get_env(getenv("DATABASE_SERVER"), 'mysql.csh.rit.edu');
12-
$DATABASE_USER = $get_env(getenv("DATABASE_USER"), '');
13-
$DATABASE_PASS = $get_env(getenv("DATABASE_PASS"), '');
14-
$DATABASE_DB = $get_env(getenv("DATABASE_DB"), '');
12+
$DATABASE_USER = $get_env(getenv("DATABASE_USER"), 'schedule_matted');
13+
$DATABASE_PASS = $get_env(getenv("DATABASE_PASS"), '47MxO5KNav1xInNG');
14+
$DATABASE_DB = $get_env(getenv("DATABASE_DB"), 'schedule_matted');
1515
$DUMPCLASSES = '/mnt/share/cshclass.dat';
1616
$DUMPCLASSATTR = '/mnt/share/cshattrib.dat';
1717
$DUMPINSTRUCT = '/mnt/share/cshinstr.dat';
@@ -78,6 +78,3 @@
7878
break;
7979
}
8080

81-
////////////////////////////////////////////////////////////////////////////
82-
// SESSION
83-

0 commit comments

Comments
 (0)