Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
## Prerequisites
Have docker and docker-compose installed.
## Usage
Build the xaseco image:

Build the xaseco alpine image:
```
$ cd xaseco
$ ./build-image.sh
$ cd ..
$ docker build -t toprock/tmserver:xaseco -f .\xaseco\Dockerfile .\xaseco\
```


Configure your server settings by editing the `docker-compose.yml` and the game settings in: `GameData/Tracks/MatchSettings/custom_game_settings.txt`
Run the stack:
```
Expand Down
31 changes: 18 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
version: '3'
services:
tmfserver:
image: lduriez/tmserver:latest
network_mode: host
tmserver:
image: toprock/tmserver:latest
volumes:
- ./GameData/Profiles:/opt/tmserver/GameData/Profiles
- ./GameData/Scores:/opt/tmserver/GameData/Scores
- ./GameData/Tracks/MatchSettings/:/opt/tmserver/GameData/Tracks/MatchSettings/
environment:
SERVER_NAME: My server # if you want colours be warned that $ needs to be escaped by $ in Docker
SERVER_DESC: Let's race
SERVER_SA_PASSWORD: SuperAdmin
SERVER_ADM_PASSWORD: Admin
ports:
- 2350:2350
- 3450:3450
- 3450:3450/udp
mysql:
image: mysql:5.5
network_mode: host
image: mysql:5.6
volumes:
- ./mysql:/var/lib/mysql
environment:
Expand All @@ -21,14 +25,15 @@ services:
MYSQL_USER: tmf
MYSQL_PASSWORD: tmfpass
xaseco:
image: xaseco:latest
network_mode: host
image: toprock/tmserver:xaseco
depends_on:
- "tmfserver"
- "tmserver"
- "mysql"
environment:
MYSQL_SERVER: '172.20.0.1'
MYSQL_LOGIN: tmf
MYSQL_PASSWORD: tmfpass
ASECO_MASTER_ADMIN: YOUR_TMF_LOGIN
SERVER_SA_PASSWORD: SuperAdmin
MYSQL_SERVER: 'mysql' #name like the service
MYSQL_LOGIN: tmf # same as MYSQL_USER
MYSQL_PASSWORD: tmfpass # same as MYSQL_PASSWORD
ASECO_MASTER_ADMIN: YOUR_TMF_LOGIN_TM #Online account name for TMNF, wont work for offline accounts
ASECO_ADMIN: ADMIN_User_Login_TM #Online account name for TMNF, wont work for offline accounts
SERVER_SA_PASSWORD: SuperAdmin # SA Password configured in tmserver
SERVER_IP: tmserver #Set this to the service / hostname of timserver
40 changes: 20 additions & 20 deletions xaseco/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# PHP 5 is mandatory to run aseco
FROM php:5.3-apache
FROM alpine:3.8

ARG MYSQL_SERVER='172.20.0.1'
ARG MYSQL_SERVER='mysql'
ARG MYSQL_LOGIN='tmf'
ARG MYSQL_PASSWORD='tmfpass'
ARG ASECO_MASTER_ADMIN='YOUR_TMF_LOGIN'
ARG ASECO_ADMIN='YOUR_TMF_LOGIN'
ARG ASECO_MASTER_ADMIN='MasterAdmin'
ARG ASECO_ADMIN='Admin'
ARG SERVER_SA_PASSWORD='SuperAdmin'
ARG SERVER_IP='tmserver'

ENV MYSQL_SERVER $MYSQL_SERVER
ENV MYSQL_LOGIN $MYSQL_LOGIN
ENV MYSQL_PASSWORD $MYSQL_PASSWORD
ENV ASECO_MASTER_ADMIN $ASECO_MASTER_ADMIN
ENV ASECO_ADMIN $ASECO_ADMIN
ENV SERVER_SA_PASSWORD $SERVER_SA_PASSWORD
ENV SERVER_IP $SERVER_IP

RUN mkdir -p /home/tmf/xaseco

WORKDIR /home/tmf/xaseco

# Allows this image to be able to wait for a DB to be ready
COPY wait-for-it.sh .

# Follow install instructions from http://www.gamers.org/tmf/quickstart.html#xaseco
COPY startup.sh .
COPY xaseco_116.zip .
RUN apt-get update && apt-get install -y --force-yes unzip php5-mysql
RUN unzip xaseco_116.zip -d ..

RUN mv newinstall/*.xml .
RUN mv newinstall/*.php ./includes/

COPY settings.sh .
RUN ./settings.sh

# Clean image
RUN rm xaseco_116.zip
RUN rm settings.sh
RUN apt-get autoremove -y unzip
# Follow install instructions from http://www.gamers.org/tmf/quickstart.html#xaseco

CMD ["./wait-for-it.sh", "127.0.0.1:3306", "--", "php", "aseco.php", "TMF"]
RUN apk update &&\
apk add unzip \
bash \
php5 \
php5-xml \
php5-mysql &&\
unzip xaseco_116.zip -d .. &&\
mv newinstall/*.xml . &&\
mv newinstall/*.php ./includes/ &&\
rm xaseco_116.zip

CMD ["./startup.sh"]
5 changes: 5 additions & 0 deletions xaseco/settings.sh → xaseco/startup.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/sh
echo "Setting ENV/ARG variables"

sed -i "s/<mysql_login>YOUR_MYSQL_LOGIN/<mysql_login>${MYSQL_LOGIN}/" localdatabase.xml
sed -i "s/<mysql_password>YOUR_MYSQL_PASSWORD/<mysql_password>${MYSQL_PASSWORD}/" localdatabase.xml
sed -i "s/<mysql_server>localhost/<mysql_server>${MYSQL_SERVER}/" localdatabase.xml
sed -i "s/<\/masteradmins>/<tmlogin>${ASECO_MASTER_ADMIN}<\/tmlogin><\/masteradmins>/" config.xml
sed -i "s/<password>YOUR_SUPERADMIN_PASSWORD/<password>${SERVER_SA_PASSWORD}/" config.xml
sed -i "s/<ip>127.0.0.1/<ip>${SERVER_IP}/" config.xml
sed -i "s/<\/admins>/<tmlogin>${ASECO_ADMIN}<\/tmlogin><\/admins>/" adminops.xml
sed -i "s/\t<plugin>plugin.dedimania.php<\/plugin>/<\!--\t<plugin>plugin.dedimania.php<\/plugin> -->/" plugins.xml
sed -i "s/\t<plugin>chat.dedimania.php<\/plugin>/<\!--\t<plugin>chat.dedimania.php<\/plugin> -->/" plugins.xml


./wait-for-it.sh "mysql:3306" "--" "php5" "aseco.php" "TMF"