Merge pull request #93 from DracoMilesX/master

Docker support
This commit is contained in:
Felix Maier
2016-08-30 12:20:41 +02:00
committed by GitHub
3 changed files with 66 additions and 0 deletions

44
Dockerfile Normal file
View File

@@ -0,0 +1,44 @@
FROM ubuntu:latest
MAINTAINER Draco Miles X
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qq mysql-server mysql-client -y && apt-get upgrade -y && apt-get dist-upgrade -y
RUN apt-get install -y \
apt-utils \
nano \
build-essential \
curl \
lsb-release \
openssl \
libssl-dev \
openssh-server \
openssh-client \
sudo \
python \
python-dev \
python-pip \
python3 \
python3-dev \
python3-pip \
pkg-config \
autoconf \
automake \
libtool \
curl \
make \
g++ \
unzip \
supervisor
RUN mkdir -p /var/run/sshd /var/log/supervisor
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN apt-get install -y \
nodejs \
git
RUN git clone --recursive https://github.com/google/protobuf.git
RUN cd /protobuf && ./autogen.sh && ./configure && make && make check && make install && ldconfig
RUN cd /
RUN git clone --recursive https://github.com/maierfelix/POGOserver.git
RUN chmod +x /POGOserver/run-linux.sh
COPY cfg.js /POGOserver/
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN service mysql start && mysql -u root -e "create database pogosql";
EXPOSE 22 80 443 3306 3000
CMD ["/usr/bin/supervisord"]

View File

@@ -58,3 +58,15 @@ The required database tables get generated automatically.
You need at minimum [Node.js](https://nodejs.org/en/) version 6.x.
Depending on your OS, you need to run either ``run-linux.sh`` or ``run-windows.bat`` from the root folder.
## Docker setup
1. Download ``Dockerfile``, ``cfg.js.example`` and ``supervisord.conf`` from github.
2. Place ``Dockerfile``, ``cfg.js.example`` and ``supervisord.conf`` into the same folder. Rename ``cfg.js.example`` to ``cfg.js``.
3. Modify ``cfg.js`` to your requirements as described above.
4. Create a container and run it.
5. Open a bash prompt, enter: ``cd /POGOserver/`` and ``./run-linux.sh``.
6. Connect the Pokemon Go app to the server.
7. Done.
Note: Instead of automatically mapping the ports, map them static, so they don't change after reboot.

10
supervisord.conf Normal file
View File

@@ -0,0 +1,10 @@
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
autorestart=true
[program:mysql]
command=/usr/bin/pidproxy /var/run/mysqld/mysqld.pid /usr/sbin/mysqld
autorestart=true