Skip to content

Commit

Permalink
Dockerizes multeor
Browse files Browse the repository at this point in the history
  • Loading branch information
filidorwiese committed Mar 7, 2021
1 parent 485f773 commit ab252e2
Show file tree
Hide file tree
Showing 18 changed files with 144 additions and 1,467 deletions.
28 changes: 28 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM debian:buster

RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl wget nano less ncat dnsutils procps \
build-essential \
openjdk-11-jre \
ruby ruby-dev \
python2.7

#gem update --system && \
RUN gem install compass

# Adds nodejs 10 repository
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get update && apt-get install -y --no-install-recommends \
nodejs

WORKDIR /app

COPY package*.json /app/

RUN npm install

COPY .docker/entrypoint.sh /

EXPOSE 8443
ENTRYPOINT ["/entrypoint.sh"]
7 changes: 7 additions & 0 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -e

mkdir -p /app/logs

npm run build

npm run start
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ codekit-config.json
high-score-*.json
/public/static/javascript/*.min.js
/public/static/css/*.css
php_errors.log
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,22 @@ The game can be played at: http://multeor.com/
The game is viewed on a desktop computer but controlled by using smartphones. Up to eight players can connect to a single game at the same time. Players can personalize their Multeor by first logging into Facebook on their controller. Multeor is great fun playing solo, but it works even better in a group. We recommend challenging friends and colleagues at the office or at a party. The more players, the more destruction, colors and chaos!

More information can be found at http://multeor.com/about/
A blog article about the techniques used: http://blog.fili.nl/project-multeor/

## Getting Multeor up and running ##

### Prerequisites ###

Please make sure you have the following installed on your system:

* Node + Npm
* Ruby
* Compass as a ruby gem
* Java JRE
* Local webserver (including php support if you want to use map-editor)
* git
* docker
* docker-compose

### Installing and building ###

1. Clone the repository
2. Install npm dependencies with `npm install`
2. Run `./multeor.sh build` to compile the sass and javascript
3. Point a webserver to the public directory as the document root

### Running Multeor ###

You can start the server-side of Multeor using `node server.js`. Alternatively use `./multeor.sh start-forever` command to run Multeor as a headless never-ending daemon, which can be stopped with `./multeor.sh stop`.
2. Run `docker-compose up`
3. Go to http://localhost

## License ##

Expand Down
Binary file added designs/zoom_0.mp4
Binary file not shown.
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.6'

services:
www:
image: php:7-apache
ports:
- "80:80"
volumes:
- ${PWD}/public/:/var/www/html/
restart: always

multeor:
build:
context: .
dockerfile: .docker/Dockerfile
ports:
- "443:1443"
volumes:
- type: bind
source: .
target: /app
- type: volume
source: node-modules
target: /app/node_modules
read_only: true
restart: always

volumes:
node-modules: {}
14 changes: 0 additions & 14 deletions multeor.service

This file was deleted.

12 changes: 1 addition & 11 deletions multeor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,11 @@ ERRLOG=$CWD/logs/multeor.error
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
JSPATH="$DIR/public/static/javascript"

if [[ $EUID -eq 0 ]]; then
su -l multeor $0 $1
exit
fi

case "$1" in
start)
echo "Starting $TITLE..."
/usr/bin/env node $CWD/server.js
;;
start-forever)
echo "Forever starting $TITLE..."
mkdir -p $CWD/logs
$CWD/node_modules/forever/bin/forever start -o $LOG -e $ERRLOG $CWD/server.js
;;
stop)
echo "Stopping $TITLE..."
$CWD/node_modules/forever/bin/forever stop $CWD/server.js
Expand All @@ -40,7 +30,7 @@ case "$1" in
/usr/bin/env compass compile $DIR
;;
*)
echo "Usage: $0 {start|start-forever|stop|restart|build}"
echo "Usage: $0 {start|stop|restart|build}"
;;
esac

Loading

0 comments on commit ab252e2

Please sign in to comment.