This repository provides a Dockerfile to create a Docker image for SmartFox Server 2X.
Make sure you have Docker installed on your system.
To pull the SmartFox Server Docker image from Docker Hub, use the following command:
docker pull dharmeshmp/smartfox:latest
This will fetch the latest version of the SmartFox Server Docker image.
To run the SmartFox Server Docker container, use the following command:
docker run -p 8080:8080 -p 8443:8443 -p 9933:9933 -p 9933:9933/udp -p 5000:5000 dharmeshmp/smartfox:latest
This will expose the necessary ports for SmartFox Server.
You can also use specific tags for different versions of SmartFox Server. For example, to use version 2.19.3, run:
docker pull dharmeshmp/smartfox:2.19.3
docker run -p 8080:8080 -p 8443:8443 -p 9933:9933 -p 9933:9933/udp -p 5000:5000 dharmeshmp/smartfox:2.19.3
If you prefer using Docker Compose, create a docker-compose.yml
file with the following content:
version: '3'
services:
smartfox:
image: dharmeshmp/smartfox:latest
ports:
- "8080:8080"
- "8443:8443"
- "9933:9933"
- "9933:9933/udp"
- "5000:5000"
Run the following command to start SmartFox Server using Docker Compose:
docker-compose up -d
This will start the SmartFox Server container in detached mode.
You can extend the SmartFox Server Docker image to customize it for your specific requirements. Create a Dockerfile with the following content:
FROM dharmeshmp/smartfox:2.19.3
# Copy custom extension JAR file
COPY build/libs/*.jar /opt/SmartFoxServer_2X/SFS2X/extensions/Joker/extension.jar
# Copy custom zone configuration
COPY docker-smartfox/zones/Joker.zone.xml /opt/SmartFoxServer_2X/SFS2X/zones/Joker.zone.xml
# Copy custom server configuration
COPY docker-smartfox/config/server.xml /opt/SmartFoxServer_2X/SFS2X/config/server.xml
# Remove UploadsLock.txt to allow file uploads
RUN rm /opt/SmartFoxServer_2X/SFS2X/config/UploadsLock.txt
This example extends the base SmartFox Server image, adding custom extension JAR files, zone configurations, and server settings. Adjust it based on your specific requirements.
The Dockerfile uses Amazon Corretto as the base image for Java 8 Alpine and downloads and installs SmartFox Server 2X.
SFS_VERSION
: SmartFox Server version.SFS_PATCH
: SmartFox Server patch version.
This Dockerfile supports ARM builds by using the --platform=linux/amd64
option with Amazon Corretto.
The following ports are exposed:
8080
: HTTP port8443
: HTTPS port9933
: Default SmartFox Server port9933/udp
: Default SmartFox Server UDP port5000
: AdminTool port
This repository includes a GitHub Actions workflow that automates the build and push of the SmartFox Server Docker image. The workflow supports multi-platform builds using Docker Buildx.
The workflow automatically tags Docker images based on versioning and branch events.
This Docker image is provided under the MIT License.