Skip to content

Latest commit

 

History

History
124 lines (101 loc) · 4.06 KB

File metadata and controls

124 lines (101 loc) · 4.06 KB
title description
Quickstart
Start building your server in minutes!

Liftoff - Init tool

We plan on developing a tool to remove the need to manually add boilerplate when making new projects. This tool is not yet ready and is not avaliable for use.

Manual setup

Step 2: Project structure

  • docker-compose.yml Docker Compose file to be used with Docker Stack in production deployments

  • dev.sh Quick utility to make spinning up dev server easier.

    #!/bin/bash
    
    cd mineframe/dev && docker compose up --build
    
  • mineframe/ Main directory for Mineframe related things. You should put stuff like your plugin source code outside of this.

    • servers/(server name) Configuration data for a server
      • Dockerfile Dockerfile for the specific server.

        FROM ubuntu:22.04
        
        RUN apt-get update && \
            apt-get install -y wget openjdk-21-jdk && \
            rm -rf /var/lib/apt/lists/*
        
        WORKDIR /app
        COPY server/ .
        COPY entrypoint.sh /app/entrypoint.sh
        RUN chmod +x /app/entrypoint.sh
        
        ENV RAM=2G
        ENV PORT=25565
        
        ENTRYPOINT ["/app/entrypoint.sh"]
        
      • entrypoint.sh Entrypoint for development server, copies data from server defenition at startup. (CODEBLOCK TODO)

      • server/ Server config, more info at Server Configuration.

    • dev/ Utilities and data specifically meant for development servers
      • Dockerfile Dockerfile to be used for the devservers. Idea behind this is to not include server files in the image, and instead load those at startup from a volume. (subject to changes upon Mineframe docker images)

        FROM ubuntu:22.04
        
        RUN apt-get update && \
            apt-get install -y wget rsync openjdk-21-jdk && \
            rm -rf /var/lib/apt/lists/*
        
        WORKDIR /app
        COPY entrypoint.sh /usr/local/bin/entrypoint.sh
        RUN chmod +x /usr/local/bin/entrypoint.sh
        RUN ls /usr/local/bin
        
        ENV RAM=2G
        ENV PORT=25565
        
        ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
        
      • docker-compose.yaml Docker compose to spin up required servers and services for development. Span up using Docker compose, not Docker stack.

        services:
          gate:
            image: ghcr.io/minekube/gate:d3c6a57
            container_name: gate
            restart: unless-stopped
            networks:
              - dev
            volumes:
              - ./gate.yaml:/config.yml
            ports:
              - "26000:26000"
          lobby: # lobby used as example, change to the server you need.
            build:
              context: .
              dockerfile: Dockerfile
            networks:
              - dev
            volumes:
              - ../servers/lobby/server:/initial_app:ro # lobby used as example, change to the server you need.
              - ./.data/lobby:/persistent_app # lobby used as example, change to the server you need.
            ports:
              - "26001:26001"
            environment:
              - PORT=26001
        
        networks:
          dev:
      • entrypoint.sh Entrypoint for development server, copies data from server defenition at startup. (CODEBLOCK TODO)

      • gate.yaml Gate configuration for development server

        config:
          bind: 0.0.0.0:26000
          onlineMode: false
          servers:
            lobby: lobby:26001
          try:
            - lobby
          forceKeyAuthentication: false

Next steps

Now that you have a Mineframe network scaffolded, check out these resources next!

Learn how server configuration is handled in the Mineframe stack. Understand how to operate a Mineframe-based server. Include syntax-highlighted code blocks.