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
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# Playit Docker Images
<div align="center"><h1>Playit Docker Images 🐳</h1>

Contains docker images for popular game servers integraded with playit to make them public.
Contains docker images for popular game servers integrated with playit to make them public.\
playit.gg is a global proxy that allows you to host a server without port forwarding. [Read more](https://playit.gg/about)

<img src="docs/playit-gg-docker.png" alt="Playit.gg">
</div>

## We provide
- TCP and UDP tunneling
- Dual stacked IPv4 and IPv6 network
- Continuous port ranges
- Static IPs and ports
**All for free!** + *extra premium features* to support the project :)

## Supported Games ✅
- [satisfactory](/satisfactory/README.md)
- [scp-secret-laboratory](/scp-secret-laboratory/README.md)
- [unturned](/unturned/README.md)
- [valheim](/valheim/README.md)

## Coming-Soon™
- Minecraft Java
- Minecraft Bedrock
- Minecraft BungeeCord
- Rust

Want More? Have Any Suugisons? [Join Our Discord](https://discord.gg/AXAbujx)
Binary file added docs/playit-gg-docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions fivem/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use the spritsail/fivem image as the base for the new image
FROM spritsail/fivem

# Install the dependencies for the playit-cli tool
RUN apt-get update && apt-get install -y \
tar curl gcc g++ lib32gcc1 libgcc1 libcurl4-gnutls-dev:i386 \
libssl1.1:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 \
lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 \
iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat \
tzdata jq wget unzip

# Download the latest version of the playit-cli tool
ENV PLAYIT_DL="https://github.com/playit-cloud/playit-agent/releases/latest"
RUN curl -o playit-cli -L "$PLAYIT_DL"
RUN chmod +x playit-cli

# Add a script to start the FiveM server using the playit-cli tool
COPY start-fivem-server.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/start-fivem-server.sh
23 changes: 23 additions & 0 deletions fivem/start-fivem-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Source the playit.env file
source playit.env || true

# Print the IP and port of the tunnel
echo "IP: ${TUNNEL_0_HOSTNAME}"
echo "Port: ${TUNNEL_0_PORT}"

# Wait for 4 seconds before starting the server
echo "starting in 4 seconds"
sleep 4;

# Start a loop that prints the tunnel address every 10 seconds
bash -c "while true; do sleep 10; echo addr = ${TUNNEL_0_HOSTNAME}:${TUNNEL_0_PORT}; done;" &

# Set the HOME environment variable to the /mnt/server directory
# and switch to that directory
export HOME=/mnt/server
cd $HOME

# Use the playit-cli tool to start the FiveM server
./playit-cli --start-server
19 changes: 19 additions & 0 deletions minecraft-bedrock/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use the itzg/minecraft-bedrock-server image as the base for the new image
FROM itzg/minecraft-bedrock-server

# Install the dependencies for the playit-cli tool
RUN apt-get update && apt-get install -y \
tar curl gcc g++ lib32gcc1 libgcc1 libcurl4-gnutls-dev:i386 \
libssl1.1:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 \
lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 \
iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat \
tzdata jq wget unzip

# Download the latest version of the playit-cli tool
ENV PLAYIT_DL="https://github.com/playit-cloud/playit-agent/releases/latest"
RUN curl -o playit-cli -L "$PLAYIT_DL"
RUN chmod +x playit-cli

# Add a script to start the Minecraft Bedrock server using the playit-cli tool
COPY start-bedrock-server.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/start-bedrock-server.sh
23 changes: 23 additions & 0 deletions minecraft-bedrock/start-bedrock-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Source the playit.env file
source playit.env || true

# Print the IP and port of the tunnel
echo "IP: ${TUNNEL_0_HOSTNAME}"
echo "Port: ${TUNNEL_0_PORT}"

# Wait for 4 seconds before starting the server
echo "starting in 4 seconds"
sleep 4;

# Start a loop that prints the tunnel address every 10 seconds
bash -c "while true; do sleep 10; echo addr = ${TUNNEL_0_HOSTNAME}:${TUNNEL_0_PORT}; done;" &

# Set the HOME environment variable to the /mnt/server directory
# and switch to that directory
export HOME=/mnt/server
cd $HOME

# Use the playit-cli tool to start the Minecraft Bedrock server
./playit-cli --start-server
19 changes: 19 additions & 0 deletions minecraft-bungeecord/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use the itzg/docker-bungeecord image as the base for the new image
FROM itzg/docker-bungeecord

# Install the dependencies for the playit-cli tool
RUN apt-get update && apt-get install -y \
tar curl gcc g++ lib32gcc1 libgcc1 libcurl4-gnutls-dev:i386 \
libssl1.1:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 \
lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 \
iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat \
tzdata jq wget unzip

# Download the latest version of the playit-cli tool
ENV PLAYIT_DL="https://github.com/playit-cloud/playit-agent/releases/latest"
RUN curl -o playit-cli -L "$PLAYIT_DL"
RUN chmod +x playit-cli

# Add a script to start the Bungeecord server using the playit-cli tool
COPY start-bungeecord-server.sh /usr/local/bin/
RUN chmod +x /
23 changes: 23 additions & 0 deletions minecraft-bungeecord/start-bungeecord-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Source the playit.env file
source playit.env || true

# Print the IP and port of the tunnel
echo "IP: ${TUNNEL_0_HOSTNAME}"
echo "Port: ${TUNNEL_0_PORT}"

# Wait for 4 seconds before starting the server
echo "starting in 4 seconds"
sleep 4;

# Start a loop that prints the tunnel address every 10 seconds
bash -c "while true; do sleep 10; echo addr = ${TUNNEL_0_HOSTNAME}:${TUNNEL_0_PORT}; done;" &

# Set the HOME environment variable to the /mnt/server directory
# and switch to that directory
export HOME=/mnt/server
cd $HOME

# Use the playit-cli tool to start the Bungeecord server
./playit-cli --start-server
22 changes: 22 additions & 0 deletions minecraft-java/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use the itzg/minecraft-server image as the base for the new image
FROM itzg/minecraft-server

# Install the dependencies for the playit-cli tool
RUN apt-get update && apt-get install -y \
tar curl gcc g++ lib32gcc1 libgcc1 libcurl4-gnutls-dev:i386 \
libssl1.1:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 \
lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 \
iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat \
tzdata jq wget unzip

# Download the latest version of the playit-cli tool
ENV PLAYIT_DL="https://github.com/playit-cloud/playit-agent/releases/latest"
RUN curl -o playit-cli -L "$PLAYIT_DL"
RUN chmod +x playit-cli

# Add a script to start the Minecraft server using the playit-cli tool
COPY start-minecraft-server.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/start-minecraft-server.sh

# Set the entrypoint to the start-minecraft-server.sh script
ENTRYPOINT ["/usr/local/bin/start-minecraft-server.sh"]
46 changes: 46 additions & 0 deletions minecraft-java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Minecraft Java Server Docker Image

This directory contains a Dockerfile for building a Docker image that can be used to run a **Minecraft Java** server using the [`itzg/minecraft-server`](https://hub.docker.com/r/itzg/minecraft-server) image and the `playit-cli` tool.\
The image includes all the necessary dependencies and the `playit-cli` tool.

## Preparation

To use this Dockerfile, you need to have the following installed on your system:

Docker: This is required to build and run the Docker image. You can install Docker on your system by following the instructions on the [Docker website](https://docs.docker.com/get-docker/).

### Building the Docker Image

To build the Docker image, follow these steps:
1. Download the latest [Release](https://github.com/playit-cloud/docker-games/releases/latest)
2. Change to the directory containing the Dockerfile:
```cd
cd minecraft-java
```
3. Build the Docker image:
```
docker build -t minecraft-java .
```
This will create a Docker image named `minecraft-java` that contains all the dependencies and the `playit-cli` tool needed to run a Minecraft Java server using the `itzg/minecraft-server` image.

### Running the Minecraft Server
To run the Minecraft server, use the following command:

```docker
docker run -d -p 25565:25565 --name mc minecraft-server
```
This will start a new Docker container named `mc` using the `minecraft-java` image and start the Minecraft server using the `playit-cli` tool.

To stop the Minecraft server and the Docker container, use the following command:
```docker
docker stop mc
```
This will stop the Docker container and the Minecraft server.

> **Warning**\
> Please note that the exact command to start the Minecraft server using playit-cli may vary depending on the version of the tool and the options you want to use. You can use the `playit-cli --help` command to see the available options and usage instructions.

## Conclusion

In this guide, we showed how to use the Dockerfile in this repository to build a Docker image for a Minecraft Java server using the `itzg/minecraft-server` image and the `playit-cli` tool, and how to use the image to run and stop the Minecraft server.\
The `playit-cli` tool makes it easy to manage the Minecraft server inside the Docker container.
23 changes: 23 additions & 0 deletions minecraft-java/start-minecraft-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Source the playit.env file
source playit.env || true

# Print the IP and port of the tunnel
echo "IP: ${TUNNEL_0_HOSTNAME}"
echo "Port: ${TUNNEL_0_PORT}"

# Wait for 4 seconds before starting the server
echo "starting in 4 seconds"
sleep 4;

# Start a loop that prints the tunnel address every 10 seconds
bash -c "while true; do sleep 10; echo addr = ${TUNNEL_0_HOSTNAME}:${TUNNEL_0_PORT}; done;" &

# Set the HOME environment variable to the /mnt/server directory
# and switch to that directory
export HOME=/mnt/server
cd $HOME

# Use the playit-cli tool to start the Minecraft server
./playit-cli --start-server