Skip to content

Commit 807fb18

Browse files
author
dmolokanov
committed
.
1 parent c21ff11 commit 807fb18

File tree

6 files changed

+109
-6
lines changed

6 files changed

+109
-6
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SERVER_PATH=/srv/samp03
2+
SERVER_GZ=samp037svr_R2-1.tar.gz
3+
EXTERNAL_PORT=7777

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM debian:bookworm-slim
2+
3+
ARG SERVER_GZ
4+
ARG SERVER_PATH
5+
6+
ENV SERVER_GZ ${SERVER_GZ}
7+
ENV SERVER_PATH ${SERVER_PATH}
8+
9+
RUN dpkg --add-architecture i386
10+
RUN apt update && \
11+
apt upgrade -yy && \
12+
apt install -yy \
13+
apt-utils \
14+
libstdc++6 \
15+
libncurses5:i386 \
16+
libstdc++6:i386 \
17+
procps
18+
19+
COPY ${SERVER_GZ} /tmp/
20+
RUN [ ! -d "${SERVER_PATH}" ] && cd /srv && tar xzvf /tmp/${SERVER_GZ}
21+
RUN chmod +x ${SERVER_PATH}/samp03svr
22+
23+
RUN ln -sf /dev/stdout ${SERVER_PATH}/server_log.txt
24+
25+
EXPOSE 7777
26+
COPY start.sh /start.sh
27+
28+
STOPSIGNAL SIGINT
29+
30+
WORKDIR ${SERVER_PATH}

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This Docker Compose configuration file (docker-compose.yml) allows you to easily set up a multi-container environment with the following services:
44

5-
- samp-server 0.3.7: A San Andreas Multiplayer server for multiplayer gaming.
5+
- Samp: A San Andreas Multiplayer server for multiplayer gaming.
66
- Redis: An open-source in-memory data structure store used as a database, cache, and message broker.
77
- Redis Commander: A web-based management tool for Redis.
88
- MySQL: A popular open-source relational database management system.
@@ -17,13 +17,14 @@ This Docker Compose configuration file (docker-compose.yml) allows you to easily
1717
- Clone this repository to your local machine.
1818

1919
3. Launch the Services:
20-
- Run the following command in the terminal in the directory where the docker-compose.yml file is located:
21-
22-
docker-compose up
20+
- Run the following command in the terminal in the directory where the docker-compose.yml file is located:
21+
```
22+
docker-compose up -d
23+
```
2324
2425
2526
4. Accessing Services:
26-
- samp-server: Connect your San Andreas Multiplayer game client to the IP and port of the Docker host. Default port : 7777
27+
- samp-server: Connect your San Andreas Multiplayer game client to the IP and port of the localhost. Default port : 7777
2728
- Redis Commander: Access it via http://localhost:7774 (login default credentials: root / (no password)).
2829
- phpMyAdmin: Access it via http://localhost:7776 (login default credentials: root / root).
2930
@@ -104,4 +105,4 @@ networks:
104105
- For detailed information on configuration options for each service, refer to the official documentation for Docker, Redis, MySQL, and phpMyAdmin.
105106
- Make sure to secure your services and use strong passwords for MySQL and phpMyAdmin access.
106107
107-
Enjoy your multi-container environment with samp-server 0.3.7, Redis, Redis Commander, MySQL, and phpMyAdmin using Docker Compose! If you have any questions or need further assistance, feel free to reach out.
108+
Enjoy your multi-container environment with samp-server, Redis, Redis Commander, MySQL, and phpMyAdmin using Docker Compose! If you have any questions or need further assistance, feel free to reach out.

docker-compose.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
version: '3.1'
2+
3+
services:
4+
db:
5+
image: mysql:5.7
6+
restart: always
7+
environment:
8+
MYSQL_ROOT_PASSWORD: root
9+
MYSQL_HOST: 127.0.0.1
10+
ports:
11+
- 3306:3306
12+
networks:
13+
- "samp-server-network"
14+
15+
phpmyadmin:
16+
image: phpmyadmin
17+
restart: always
18+
ports:
19+
- 7776:80
20+
environment:
21+
- PMA_ARBITRARY=0
22+
23+
redis:
24+
image: redis:latest
25+
restart: always
26+
ports:
27+
- "6379:6379"
28+
volumes:
29+
- ./scriptfiles/docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
30+
environment:
31+
- REDIS_PASSWORD=root
32+
- REDIS_PORT=6379
33+
- REDIS_DATABASES=16
34+
networks:
35+
- "samp-server-network"
36+
37+
redis-commander:
38+
image: rediscommander/redis-commander:latest
39+
restart: always
40+
environment:
41+
REDIS_HOSTS: redis
42+
REDIS_HOST: redis
43+
REDIS_PORT: redis:6379
44+
REDIS_PASSWORD:
45+
HTTP_USER: root
46+
HTTP_PASSWORD: root
47+
ports:
48+
- 7774:8081
49+
50+
samp-server:
51+
restart: always
52+
build:
53+
context: .
54+
args:
55+
SERVER_PATH: ${SERVER_PATH}
56+
SERVER_GZ: ${SERVER_GZ}
57+
entrypoint: "/start.sh"
58+
image: dmolokanov:samp-server
59+
ports:
60+
- ${EXTERNAL_PORT}:7777/tcp
61+
- ${EXTERNAL_PORT}:7777/udp
62+
networks:
63+
- "samp-server-network"
64+
networks:
65+
samp-server-network:
66+
name: samp-server-network

samp037svr_R2-1.tar.gz

1.43 MB
Binary file not shown.

start.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
exec /srv/samp03/samp03svr

0 commit comments

Comments
 (0)