The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
docker & sphereserver - install tutorial
Author Message
naklma
Apprentice
*

Posts: 5
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Feb 2020
Reputation: 0



Post: #1
docker & sphereserver - install tutorial
Necessary things:
- hub.docker
- vps with docker or kubernetes
- git repository or local docker

My configuration:
BitBucket (git repository) -> pipeline -> hub.docker -> artificial ssh cmd -> deploy sh

File: Dockerfile
Code:
FROM amd64/ubuntu:19.04
MAINTAINER Martin Nakladal "ok2uec@gmail.com"

LABEL vendor1="Sphereserver"
LABEL vendor2="Ultima Online"

ENV DEBIAN_FRONTEND noninteractive

#RUN dpkg --add-architecture i386
RUN apt update && apt install -y libmysql++ libmysqlclient-dev unzip git gcc g++ make && rm -rf /var/lib/apt/lists/*
RUN mkdir /source
WORKDIR "/source"
RUN git clone https://github.com/SphereServer/Source.git
WORKDIR "/source/Source"
RUN make NIGHTLY=1
RUN rm -rf /source/Source/src
RUN rm -rf /source/Source/makefile
RUN chmod +x /source/Source/spheresvr

EXPOSE 2593
ENTRYPOINT ["/source/Source/spheresvr"]

DockerHub:
- create repository
- create pass for application in setting account

Pipeline bitbucket
file:bitbucket-pipelines.yml
Code:
image: atlassian/default-image:2

pipelines:
  default:
    - step:
        services:
          - docker
        script:  
          - export IMAGE_NAME=naklma/sphereserver:v$BITBUCKET_COMMIT
          - docker build -t $IMAGE_NAME .
          - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
          - docker push $IMAGE_NAME
repository variable $DOCKER_HUB_USERNAME
repository variable $DOCKER_HUB_PASSWORD

VPS server:
in terminal:
- docker login
(auth you login)

Code:
mkdir  /sphereserver
mkdir /sphereserver/data

over FTP copy folder & file:
- accounts  logs  mul  save  scripts  sphereCrypt.ini  sphere.ini

test:
ls -al /sphereserver/data

Modify sphere.ini
ServIP=127.0.0.1
ServPort=2593
RestAPIPublicIP=checkip.amazonaws.com


Code:
docker network create --driver=bridge --subnet=192.168.100.0/16 --gateway 192.168.100.1 sphereserver

docker run -d \
  -it \
  -p 2593:2593/tcp \
  -p 2593:2593/udp \
  --ip 192.168.100.2 \
  --hostname sphereserver \
  --net sphereserver \
  --restart unless-stopped \
  --name sphereserver \
  --mount type=bind,source=/sphereserver/data/accounts,target=/source/Source/accounts \
  --mount type=bind,source=/sphereserver/data/logs,target=/source/Source/logs \
  --mount type=bind,source=/sphereserver/data/mul,target=/source/Source/mul \
  --mount type=bind,source=/sphereserver/data/save,target=/source/Source/save \
  --mount type=bind,source=/sphereserver/data/scripts,target=/source/Source/scripts \
  --mount type=bind,source=/sphereserver/data/sphere.ini,target=/source/Source/sphere.ini \
  --mount type=bind,source=/sphereserver/data/sphereCrypt.ini,target=/source/Source/sphereCrypt.ini \
  naklma/sphereserver:vcf0bb2976eded224f51e03a1fb0107939b426733

try to log in .. it should go ..

Firewall enable port 2593 !!! in/out


Auxiliary commands:
docker exec -it <containerIDorNAME> bash
------
docker logs <containerIDorNAME>
------
docker container stop sphereserver
docker container rm sphereserver

Avid gamer | Linux Server Admin | C# & Python & PHP Programmer | C gourmet
(This post was last modified: 02-13-2020 05:13 PM by naklma.)
02-13-2020 05:11 PM
Find all posts by this user Like Post Quote this message in a reply
Jhobean
Journeyman
*

Posts: 98
Likes Given: 11
Likes Received: 9 in 3 posts
Joined: Jun 2019
Reputation: 2



Post: #2
RE: docker & sphereserver - install tutorial
Nice work! Thx

https://www.uocryptonite.com/
02-27-2020 02:35 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)