-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add database for local server * Add docker files for local server * Add how to run local server with Docker
- Loading branch information
Showing
4 changed files
with
72 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 |
---|---|---|
|
@@ -52,3 +52,30 @@ $ ./server.py | |
|
||
# Logs | ||
- `$PWD/server.log` | ||
|
||
# Run local server via Docker | ||
Build and run local server | ||
``` | ||
$ cd docker | ||
$ docker-compose build | ||
$ docker-compose up | ||
``` | ||
To obtain container id execute and search for uberserver | ||
``` | ||
$ docker ps | ||
``` | ||
Adding users. Directory will be /root/uberserver. | ||
``` | ||
$ docker exec -it your_container_id bash | ||
$ sqlite3 local_server.db | ||
``` | ||
Add user to the database. Choose name you prefer to login. Role can be changed, see predefined values in the server code. Password will be 123. E-mail can be arbitrary, but uniq. | ||
``` | ||
insert into users(username, password, register_date, ingame_time, access, email, bot) values ('user1', 'ICy5YqxZB1uWSwcVLSNLcA==', DATE('NOW'), 0, 'user', '[email protected]', 0); | ||
``` | ||
Use your local machine address or find private uberserver address via Docker logs command | ||
``` | ||
$ docker logs your_container_id | ||
``` | ||
The address looks like "private: 192.168.100.17:8200" | ||
For now you can login to local uberserver 192.168.100.17:8200 user/password user1/123 |
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,36 @@ | ||
FROM ubuntu:22.04 | ||
RUN apt-get update -y | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get install -y software-properties-common \ | ||
wget \ | ||
python3-pip \ | ||
python3-venv \ | ||
python3-dev \ | ||
build-essential \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
make \ | ||
vim \ | ||
git \ | ||
openssl \ | ||
autogen \ | ||
libssl-dev \ | ||
less \ | ||
mysql-server \ | ||
libmysqlclient-dev \ | ||
libgeoip-dev \ | ||
default-libmysqlclient-dev \ | ||
pkg-config \ | ||
sqlite3 | ||
|
||
RUN cd /root && \ | ||
git clone https://github.com/a-pavlov/uberserver.git && \ | ||
cd uberserver && \ | ||
echo "GeoIP==1.3.2\n#mysqlclient==1.3.10\npyOpenSSL==23.0.0\nSQLAlchemy==1.3.0\nTwisted==22.10.0" > ./requirements.txt && \ | ||
pip install -r requirements.txt | ||
|
||
WORKDIR "/root/uberserver" | ||
|
||
ENTRYPOINT [ "./server.py", "-s", "sqlite:///local_server.db" ] |
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,9 @@ | ||
version: "3" | ||
|
||
services: | ||
app: | ||
image: uberserver:latest | ||
build: . | ||
ports: | ||
- "8200:8200" | ||
network_mode: host |
Binary file not shown.