-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile and docker-compose files for local development
- Loading branch information
Showing
10 changed files
with
299 additions
and
0 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,3 @@ | ||
NON_WEB/ | ||
install/ | ||
.git/ |
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,19 @@ | ||
FROM php:5.6-apache | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
RUN apt-get update && apt-get install -y ssmtp \ | ||
&& docker-php-ext-install mysql \ | ||
&& rm -rf /var/lib/{apt,dpkg,cache,log} | ||
|
||
COPY docker-config/system/ / | ||
|
||
COPY --chown=www-data:www-data . /var/www/html/ | ||
|
||
COPY --chown=www-data:www-data docker-config/bitsand/inc/ inc/ | ||
|
||
COPY --chown=www-data:www-data inc/admin_dist.css inc/admin.css | ||
COPY --chown=www-data:www-data inc/body_dist.css inc/body.css | ||
COPY --chown=www-data:www-data inc/help_dist.css inc/help.css | ||
COPY --chown=www-data:www-data terms_dist.php terms.php | ||
|
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,45 @@ | ||
# Local development in docker | ||
|
||
## First time setup | ||
|
||
1. Build and start the container | ||
|
||
docker-compose build | ||
docker-compose up | ||
|
||
2. Visit the install page at http://127.0.0.1/install/ | ||
|
||
3. Go through the usual install on that page described in the main bitsand README | ||
(https://github.com/PeteAUK/bitsand/blob/master/README.md) | ||
|
||
## Day to day usage | ||
|
||
1. Just start the container | ||
|
||
docker-compose up | ||
|
||
## Running the production container | ||
|
||
The default container will mount the bitsand directory into the container as the website to serve, this means changes | ||
you make to the files on disk locally will be reflected instantly in the running container. The downside to this is you | ||
are not doing a real test of the docker container which you want to run in production, you also have the NON\_WEB and | ||
install directories available, these should _not_ be available when running bitsand in production, having them is an | ||
extremely serious security risk. | ||
|
||
You can start the production version of the container by running with the production docker-compose file instead. | ||
|
||
docker-compose -f docker-compose.production.yaml up | ||
|
||
Remember, while running the production container no changes you make locally will be reflected in the running | ||
container, to see any change in this container you will need to rebuild the container and start it again. | ||
|
||
docker-compose -f docker-compose.production.yaml down | ||
docker-compose -f docker-compose.production.yaml build | ||
docker-compose -f docker-compose.production.yaml up | ||
|
||
## Emails | ||
|
||
The docker-compose will run a service called Mailhog which will capture all emails sent by bitsand, you can view any | ||
emails it sends at http://127.0.0.1:8025 | ||
|
||
Note all emails will be lost if you stop and start the service |
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,42 @@ | ||
version: '3' | ||
services: | ||
bitsand_production: | ||
build: . | ||
ports: | ||
- "80:80" | ||
environment: | ||
- BITSAND_ROOT_USER_ID=2 | ||
- BITSAND_DB_HOST=mysql | ||
- BITSAND_DB_NAME=bitsandtest | ||
- BITSAND_DB_USER=bitsandtest | ||
- BITSAND_DB_PASS=Lahja3lie5wohphahna7IhailiemupohL3Aehoa2Oil9ahD7iMohvei1tuuG3akusoohooleecai9moogah1eiNooSh9yoo2thai | ||
- BITSAND_ENCRYPTION_KEY=ceichohr6oothohmuu1pai0pi4aw9pheu1AiMeiliequiy1juethishah5Ooshie3oog2oGhie6luu5ooHak6meiJaif0ohfait1 | ||
- BITSAND_PW_SALT=johvah4buath9kae4veeteezah5saesh0ahc7maiveiYi5Aeso4teeKa1eich7wei4nahyoaquai0phuRahLukaiQuatae4ohghi | ||
- BITSAND_SYSTEM_URL=http://127.0.0.1/ | ||
- BITSAND_DEBUG_MODE=FALSE | ||
- BITSAND_MAINTAINENCE_MODE=FALSE | ||
- BITSAND_LOG_WARNINGS=TRUE | ||
- BITSAND_LOG_ERRORS=TRUE | ||
depends_on: | ||
- mailhog | ||
- mysql | ||
|
||
mysql: | ||
image: mysql:5.6 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=ev3aem6quaLaem0aeba4osheeloh1aeV2quei6Ea1soleed9XeeGh5ohmooxohtim7vaigeiquai5aich5xikiothee9hee0oi9i | ||
- MYSQL_DATABASE=bitsandtest | ||
- MYSQL_USER=bitsandtest | ||
- MYSQL_PASSWORD=Lahja3lie5wohphahna7IhailiemupohL3Aehoa2Oil9ahD7iMohvei1tuuG3akusoohooleecai9moogah1eiNooSh9yoo2thai | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
|
||
mailhog: | ||
image: mailhog/mailhog:latest | ||
ports: | ||
- 1025:1025 | ||
- 8025:8025 | ||
|
||
volumes: | ||
mysql: | ||
driver: local |
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,49 @@ | ||
version: '3' | ||
services: | ||
bitsand: | ||
build: . | ||
ports: | ||
- "80:80" | ||
environment: | ||
- BITSAND_ROOT_USER_ID=2 | ||
- BITSAND_DB_HOST=mysql | ||
- BITSAND_DB_NAME=bitsandtest | ||
- BITSAND_DB_USER=bitsandtest | ||
- BITSAND_DB_PASS=Lahja3lie5wohphahna7IhailiemupohL3Aehoa2Oil9ahD7iMohvei1tuuG3akusoohooleecai9moogah1eiNooSh9yoo2thai | ||
- BITSAND_ENCRYPTION_KEY=ceichohr6oothohmuu1pai0pi4aw9pheu1AiMeiliequiy1juethishah5Ooshie3oog2oGhie6luu5ooHak6meiJaif0ohfait1 | ||
- BITSAND_PW_SALT=johvah4buath9kae4veeteezah5saesh0ahc7maiveiYi5Aeso4teeKa1eich7wei4nahyoaquai0phuRahLukaiQuatae4ohghi | ||
- BITSAND_SYSTEM_URL=http://127.0.0.1/ | ||
- BITSAND_DEBUG_MODE=TRUE | ||
- BITSAND_MAINTAINENCE_MODE=FALSE | ||
- BITSAND_LOG_WARNINGS=TRUE | ||
- BITSAND_LOG_ERRORS=TRUE | ||
depends_on: | ||
- mailhog | ||
- mysql | ||
volumes: | ||
- .:/var/www/html/ | ||
- ./docker-config/bitsand/inc/inc_config.php:/var/www/html/inc/inc_config.php | ||
- ./docker-config/bitsand/inc/inc_error.php:/var/www/html/inc/inc_error.php | ||
- ./inc/admin_dist.css:/var/www/html/inc/admin.css | ||
- ./inc/body_dist.css:/var/www/html/inc/body.css | ||
- ./inc/help_dist.css:/var/www/html/inc/help.css | ||
|
||
mysql: | ||
image: mysql:5.6 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=ev3aem6quaLaem0aeba4osheeloh1aeV2quei6Ea1soleed9XeeGh5ohmooxohtim7vaigeiquai5aich5xikiothee9hee0oi9i | ||
- MYSQL_DATABASE=bitsandtest | ||
- MYSQL_USER=bitsandtest | ||
- MYSQL_PASSWORD=Lahja3lie5wohphahna7IhailiemupohL3Aehoa2Oil9ahD7iMohvei1tuuG3akusoohooleecai9moogah1eiNooSh9yoo2thai | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
|
||
mailhog: | ||
image: mailhog/mailhog:latest | ||
ports: | ||
- 1025:1025 | ||
- 8025:8025 | ||
|
||
volumes: | ||
mysql: | ||
driver: local |
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,81 @@ | ||
<?php | ||
/*----------------------------------------------------------------------------- | ||
| Bitsand - an online booking system for Live Role Play events | ||
| | ||
| File inc/inc_config_dist.php | ||
| Author: Russell Phillips | ||
| Copyright: (C) 2006 - 2015 The Bitsand Project | ||
| (http://github.com/PeteAUK/bitsand) | ||
| | ||
| Bitsand is free software; you can redistribute it and/or modify it under the | ||
| terms of the GNU General Public License as published by the Free Software | ||
| Foundation, either version 3 of the License, or (at your option) any later | ||
| version. | ||
| | ||
| Bitsand is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
| details. | ||
| | ||
| You should have received a copy of the GNU General Public License along with | ||
| Bitsand. If not, see <http://www.gnu.org/licenses/>. | ||
+---------------------------------------------------------------------------*/ | ||
|
||
// Root user ID (Just the number - do not include leading zero's or the prefix defined above) | ||
// This user will have more privileges than anyone else, including admin users | ||
// The default is NULL, which equates to no-one | ||
// Note that the value is not enclosed in quote marks | ||
define ('ROOT_USER_ID', $_ENV["BITSAND_ROOT_USER_ID"]); | ||
// Prefix for player ID. Player ID will be this prefix followed by a number | ||
define ('PID_PREFIX', ''); | ||
|
||
// Type of database. Valid values are 'mysql' (for the PHP MySQL extension) or 'mysqli' (for the PHP Improved MySQL extension) | ||
define ('DB_TYPE','mysql'); | ||
// MySQL hostname | ||
define ('DB_HOST', $_ENV["BITSAND_DB_HOST"]); | ||
// Name of MySQL database | ||
define ('DB_NAME', $_ENV["BITSAND_DB_NAME"]); | ||
// Table prefix. All tables will start with this, if defined. Can be useful if you have multiple applications sharing a single database | ||
define ('DB_PREFIX',''); | ||
// MySQL user name & password. User must have SELECT, INSERT, UPDATE & DELETE privileges | ||
define ('DB_USER', $_ENV["BITSAND_DB_USER"]); | ||
define ('DB_PASS', $_ENV["BITSAND_DB_PASS"]); | ||
|
||
// The following items are used for encryption | ||
// For each one, use a long (a least twice as long as the minimum password length) string of random characters. | ||
// Do not use an intelligible phrase or word. Do not use single or double quote marks (' or ") | ||
// Key for encryption of OOC data | ||
define ('CRYPT_KEY', $_ENV["BITSAND_ENCRYPTION_KEY"]); | ||
// Password salts | ||
define ('PW_SALT', $_ENV['BITSAND_PW_SALT']); | ||
define ('OLD_PW_SALT',''); | ||
|
||
// Web site address where the system is hosted. | ||
// Include the 'http://' (or 'https://') prefix and trailing '/' but do not include 'index.php'. | ||
// Examples: | ||
// 'http://www.domain.tld/' is valid | ||
// 'http://www.domain.tld' is invalid | ||
// 'http://www.domain.tld/index.php' is invalid | ||
// 'www.domain.tld/' is invalid | ||
define ('SYSTEM_URL', $_ENV["BITSAND_SYSTEM_URL"]); | ||
|
||
// Set to True to enable debug mode (errors & warnings are reported) DO NOT USE EXCEPT WHEN TESTING | ||
// Note that True and False are not enclosed in quote marks | ||
define ('DEBUG_MODE', $_ENV["BITSAND_DEBUG_MODE"] === "TRUE"); | ||
// Set to True to enable maintenance mode (ie users will be shown a 'site is down for maintenance' message) | ||
define ('MAINTENANCE_MODE', $_ENV["BITSAND_MAINTAINENCE_MODE"] === "TRUE"); | ||
|
||
// Log files. These must be writeable by the web server user | ||
// One file can be used for both if desired - just specify the same file name for both | ||
// If no logs are required (not recommended), set both to '' | ||
// NOTE THAT THIS IS NOT A URL - IT IS A LOCAL FILE. So, for instance, | ||
// on a Windows server, this might be something like 'c:\web\bitsand\log.txt', | ||
// on a Unix/Linux server, it might be something like '/home/web/bitsand.log' | ||
define ('WARNING_LOG', $_ENV["BITSAND_LOG_WARNINGS"] === "TRUE"); | ||
define ('ERROR_LOG', $_ENV["BITSAND_LOG_ERRORS"] === "TRUE"); | ||
|
||
/* Items below here should not need to be edited */ | ||
define ('NUM_GUILDS',10); | ||
define ('MAX_CHAR_PTS',16); | ||
define ('MAX_NPC_PTS',20); | ||
define ('MAX_OSPS',24); |
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,46 @@ | ||
<?php | ||
/*----------------------------------------------------------------------------- | ||
| Bitsand - an online booking system for Live Role Play events | ||
| | ||
| File inc/inc_error.php | ||
| Author: Russell Phillips | ||
| Copyright: (C) 2006 - 2015 The Bitsand Project | ||
| (http://github.com/PeteAUK/bitsand) | ||
| | ||
| Bitsand is free software; you can redistribute it and/or modify it under the | ||
| terms of the GNU General Public License as published by the Free Software | ||
| Foundation, either version 3 of the License, or (at your option) any later | ||
| version. | ||
| | ||
| Bitsand is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
| details. | ||
| | ||
| You should have received a copy of the GNU General Public License along with | ||
| Bitsand. If not, see <http://www.gnu.org/licenses/>. | ||
+---------------------------------------------------------------------------*/ | ||
|
||
//inc_error.php - error handling/logging routines | ||
if (DEBUG_MODE) | ||
//Report all errors except E_NOTICE - use for debugging | ||
error_reporting (E_ALL ^ E_NOTICE); | ||
else | ||
//Turn off all error reporting | ||
error_reporting (0); | ||
|
||
//Log an error. $sMsg is text to write to file | ||
function LogError ($sMsg) { | ||
if (ERROR_LOG) { | ||
$sWrite = date ('d M Y H:i:s') . "\n$sMsg\n------------\n"; | ||
error_log($sWrite, 0); | ||
} | ||
} | ||
|
||
//Log a warning. $sMsg is text to write to file | ||
function LogWarning ($sMsg) { | ||
if (WARNING_LOG) { | ||
$sWrite = date ('d M Y H:i:s') . "\n$sMsg\n------------\n"; | ||
error_log($sWrite, 0); | ||
} | ||
} |
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 @@ | ||
# The user that gets all the mails (UID < 1000, usually the admin) | ||
[email protected] | ||
|
||
# The mail server (where the mail is sent to), both port 465 or 587 should be acceptable | ||
# See also https://support.google.com/mail/answer/78799 | ||
mailhub=mailhog:1025 | ||
|
||
# The address where the mail appears to come from for user authentication. | ||
rewriteDomain=gmail.com | ||
|
||
# The full hostname. Must be correctly formed, fully qualified domain name or GMail will reject connection. | ||
hostname=gmail.com |
1 change: 1 addition & 0 deletions
1
docker-config/system/usr/local/etc/php/conf.d/date.timezone.ini
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 @@ | ||
date.timezone = "UTC" |
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 @@ | ||
sendmail_path="sendmail -t" |