mirror of
https://github.com/dragonlock2/matthewtran.com.git
synced 2025-10-11 20:17:54 +00:00
update volume creation
This commit is contained in:
parent
b714e2895b
commit
2107249f47
20
README.md
20
README.md
@ -8,7 +8,7 @@ Stuff that's deployed on [matthewtran.com](http://matthewtran.com). Tested on Ub
|
|||||||
- p2pool (`xmrig -o matthewtran.com:3333`)
|
- p2pool (`xmrig -o matthewtran.com:3333`)
|
||||||
- minecraft
|
- minecraft
|
||||||
- minecraft bedrock
|
- minecraft bedrock
|
||||||
- ~~terraria~~
|
- terraria
|
||||||
- wireguard
|
- wireguard
|
||||||
|
|
||||||
## setup
|
## setup
|
||||||
@ -44,14 +44,22 @@ docker compose build
|
|||||||
docker compose up -d # auto restarts on reboot!
|
docker compose up -d # auto restarts on reboot!
|
||||||
```
|
```
|
||||||
|
|
||||||
Note for first start you'll need to configure Gitea. You may also need to `chown` and `chmod` the mounted folders for each container.
|
Note for first start you'll need to configure Gitea.
|
||||||
|
|
||||||
## backup
|
## backup
|
||||||
|
|
||||||
Run `./backup` and save the resultant `data.zip` somewhere. I should probably automate this.
|
Run `./backup.sh` and save the resultant `data.zip` somewhere. I should probably automate this.
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- full setup script
|
- better setup
|
||||||
- correct volume mounting w/o need `chown`/`chmod`
|
- install ubuntu
|
||||||
- better backup and restore
|
- forward ports
|
||||||
|
- enable ssh
|
||||||
|
- install wireguard
|
||||||
|
- run script to setup wireguard
|
||||||
|
- install docker + compose
|
||||||
|
- run `volumes.sh` => container user has same uid/gid, can access
|
||||||
|
- run docker compose
|
||||||
|
- ufw?
|
||||||
|
- need to setup gitea
|
||||||
|
36
compose.yml
36
compose.yml
@ -31,7 +31,7 @@ services:
|
|||||||
monerod:
|
monerod:
|
||||||
restart: always
|
restart: always
|
||||||
build: monerod/.
|
build: monerod/.
|
||||||
entrypoint: ["/bin/sh", "/home/matt/entry.sh"]
|
entrypoint: ["/bin/sh", "/home/ubuntu/entry.sh"]
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
@ -39,11 +39,11 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- default6
|
- default6
|
||||||
volumes:
|
volumes:
|
||||||
- ./monerod/.bitmonero:/home/matt/.bitmonero
|
- ./monerod/.bitmonero:/home/ubuntu/.bitmonero
|
||||||
p2pool:
|
p2pool:
|
||||||
restart: always
|
restart: always
|
||||||
build: p2pool/.
|
build: p2pool/.
|
||||||
entrypoint: ["/bin/sh", "/home/matt/entry.sh"]
|
entrypoint: ["/bin/sh", "/home/ubuntu/entry.sh"]
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
@ -53,36 +53,36 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- default6
|
- default6
|
||||||
volumes:
|
volumes:
|
||||||
- ./p2pool/cache:/home/matt/cache
|
- ./p2pool/cache:/home/ubuntu/cache
|
||||||
- /dev/hugepages:/dev/hugepages
|
- /dev/hugepages:/dev/hugepages
|
||||||
minecraft:
|
minecraft:
|
||||||
restart: always
|
restart: always
|
||||||
build: minecraft/.
|
build: minecraft/.
|
||||||
entrypoint: ["/bin/sh", "/home/matt/entry.sh"]
|
entrypoint: ["/bin/sh", "/home/ubuntu/entry.sh"]
|
||||||
ports:
|
ports:
|
||||||
- "25565:25565"
|
- "25565:25565"
|
||||||
networks:
|
networks:
|
||||||
- default6
|
- default6
|
||||||
volumes:
|
volumes:
|
||||||
- ./minecraft/world:/home/matt/world
|
- ./minecraft/world:/home/ubuntu/world
|
||||||
minecraft_bedrock:
|
minecraft_bedrock:
|
||||||
restart: always
|
restart: always
|
||||||
build: minecraft_bedrock/.
|
build: minecraft_bedrock/.
|
||||||
entrypoint: ["/bin/sh", "/home/matt/entry.sh"]
|
entrypoint: ["/bin/sh", "/home/ubuntu/entry.sh"]
|
||||||
ports:
|
ports:
|
||||||
- "19132:19132/udp"
|
- "19132:19132/udp"
|
||||||
- "19133:19133/udp"
|
- "19133:19133/udp"
|
||||||
networks:
|
networks:
|
||||||
- default6
|
- default6
|
||||||
volumes:
|
volumes:
|
||||||
- ./minecraft_bedrock/worlds:/home/matt/worlds
|
- ./minecraft_bedrock/worlds:/home/ubuntu/worlds
|
||||||
# terraria:
|
terraria:
|
||||||
# restart: always
|
restart: always
|
||||||
# build: terraria/.
|
build: terraria/.
|
||||||
# entrypoint: ["/bin/sh", "/home/matt/entry.sh"]
|
entrypoint: ["/bin/sh", "/home/ubuntu/entry.sh"]
|
||||||
# ports:
|
ports:
|
||||||
# - "7777:7777"
|
- "7777:7777"
|
||||||
# networks:
|
networks:
|
||||||
# - default6
|
- default6
|
||||||
# volumes:
|
volumes:
|
||||||
# - ./terraria/worlds:/home/matt/worlds
|
- ./terraria/worlds:/home/ubuntu/worlds
|
||||||
|
@ -3,9 +3,8 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get -y upgrade
|
RUN apt-get update && apt-get -y upgrade
|
||||||
RUN apt-get install -y wget openjdk-21-jre
|
RUN apt-get install -y wget openjdk-21-jre
|
||||||
|
|
||||||
RUN useradd -m matt
|
USER ubuntu
|
||||||
USER matt
|
WORKDIR /home/ubuntu
|
||||||
WORKDIR /home/matt
|
|
||||||
|
|
||||||
RUN wget https://github.com/Tiiffi/mcrcon/releases/download/v0.7.2/mcrcon-0.7.2-linux-x86-64.tar.gz
|
RUN wget https://github.com/Tiiffi/mcrcon/releases/download/v0.7.2/mcrcon-0.7.2-linux-x86-64.tar.gz
|
||||||
RUN tar xvf mcrcon-0.7.2-linux-x86-64.tar.gz
|
RUN tar xvf mcrcon-0.7.2-linux-x86-64.tar.gz
|
||||||
@ -13,7 +12,7 @@ RUN tar xvf mcrcon-0.7.2-linux-x86-64.tar.gz
|
|||||||
# from https://www.minecraft.net/en-us/download/server (currently 1.21)
|
# from https://www.minecraft.net/en-us/download/server (currently 1.21)
|
||||||
RUN wget https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar
|
RUN wget https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar
|
||||||
|
|
||||||
COPY --chown=matt:matt eula.txt ./
|
COPY --chown=ubuntu:ubuntu eula.txt ./
|
||||||
COPY --chown=matt:matt entry.sh ./
|
COPY --chown=ubuntu:ubuntu entry.sh ./
|
||||||
COPY --chown=matt:matt server.properties ./
|
COPY --chown=ubuntu:ubuntu server.properties ./
|
||||||
COPY --chown=matt:matt ops.json ./
|
COPY --chown=ubuntu:ubuntu ops.json ./
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#Minecraft server properties
|
|
||||||
allow-flight=false
|
allow-flight=false
|
||||||
allow-nether=true
|
allow-nether=true
|
||||||
broadcast-console-to-ops=true
|
broadcast-console-to-ops=true
|
||||||
|
@ -3,14 +3,13 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get -y upgrade
|
RUN apt-get update && apt-get -y upgrade
|
||||||
RUN apt-get install -y wget unzip curl
|
RUN apt-get install -y wget unzip curl
|
||||||
|
|
||||||
RUN useradd -m matt
|
USER ubuntu
|
||||||
USER matt
|
WORKDIR /home/ubuntu
|
||||||
WORKDIR /home/matt
|
|
||||||
|
|
||||||
# from https://www.minecraft.net/en-us/download/server/bedrock (currently 1.21.23.01)
|
# from https://www.minecraft.net/en-us/download/server/bedrock (currently 1.21.23.01)
|
||||||
RUN wget -O server.zip https://minecraft.azureedge.net/bin-linux/bedrock-server-1.21.23.01.zip
|
RUN wget -O server.zip https://minecraft.azureedge.net/bin-linux/bedrock-server-1.21.23.01.zip
|
||||||
RUN unzip server.zip && rm server.zip
|
RUN unzip server.zip && rm server.zip
|
||||||
|
|
||||||
COPY --chown=matt:matt entry.sh ./
|
COPY --chown=ubuntu:ubuntu entry.sh ./
|
||||||
COPY --chown=matt:matt server.properties ./
|
COPY --chown=ubuntu:ubuntu server.properties ./
|
||||||
COPY --chown=matt:matt permissions.json ./
|
COPY --chown=ubuntu:ubuntu permissions.json ./
|
||||||
|
@ -3,12 +3,11 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get -y upgrade
|
RUN apt-get update && apt-get -y upgrade
|
||||||
RUN apt-get install -y wget bzip2
|
RUN apt-get install -y wget bzip2
|
||||||
|
|
||||||
RUN useradd -m matt
|
USER ubuntu
|
||||||
USER matt
|
WORKDIR /home/ubuntu
|
||||||
WORKDIR /home/matt
|
|
||||||
|
|
||||||
RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.3.4.tar.bz2 -O monerod.tar.bz2
|
RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.3.4.tar.bz2 -O monerod.tar.bz2
|
||||||
RUN tar xvf monerod.tar.bz2 && rm monerod.tar.bz2
|
RUN tar xvf monerod.tar.bz2 && rm monerod.tar.bz2
|
||||||
RUN mv monero-x86_64-linux-gnu-v0.18.3.4 monero
|
RUN mv monero-x86_64-linux-gnu-v0.18.3.4 monero
|
||||||
|
|
||||||
COPY --chown=matt:matt entry.sh ./
|
COPY --chown=ubuntu:ubuntu entry.sh ./
|
||||||
|
@ -3,13 +3,12 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get -y upgrade
|
RUN apt-get update && apt-get -y upgrade
|
||||||
RUN apt-get install -y wget
|
RUN apt-get install -y wget
|
||||||
|
|
||||||
RUN useradd -m matt
|
USER ubuntu
|
||||||
USER matt
|
WORKDIR /home/ubuntu
|
||||||
WORKDIR /home/matt
|
|
||||||
|
|
||||||
# currently v4.1
|
# currently v4.1
|
||||||
RUN wget https://github.com/SChernykh/p2pool/releases/download/v4.1/p2pool-v4.1-linux-x64.tar.gz -O p2pool.tar.gz
|
RUN wget https://github.com/SChernykh/p2pool/releases/download/v4.1/p2pool-v4.1-linux-x64.tar.gz -O p2pool.tar.gz
|
||||||
RUN tar xvf p2pool.tar.gz && rm p2pool.tar.gz
|
RUN tar xvf p2pool.tar.gz && rm p2pool.tar.gz
|
||||||
RUN mv p2pool-v4.1-linux-x64/p2pool ./p2pool
|
RUN mv p2pool-v4.1-linux-x64/p2pool ./p2pool
|
||||||
|
|
||||||
COPY --chown=matt:matt entry.sh ./
|
COPY --chown=ubuntu:ubuntu entry.sh ./
|
||||||
|
@ -3,19 +3,18 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get -y upgrade
|
RUN apt-get update && apt-get -y upgrade
|
||||||
RUN apt-get install -y wget unzip
|
RUN apt-get install -y wget unzip
|
||||||
|
|
||||||
RUN useradd -m matt
|
USER ubuntu
|
||||||
USER matt
|
WORKDIR /home/ubuntu
|
||||||
WORKDIR /home/matt
|
|
||||||
|
|
||||||
# from https://terraria.fandom.com/wiki/Server (currently 1.4.4.9)
|
# from https://terraria.fandom.com/wiki/Server (currently 1.4.4.9)
|
||||||
RUN wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-1449.zip
|
RUN wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-1449.zip
|
||||||
RUN unzip terraria-server-1449.zip && rm terraria-server-1449.zip
|
RUN unzip terraria-server-1449.zip && rm terraria-server-1449.zip
|
||||||
RUN mv 1449/ server/
|
RUN mv 1449/ server/
|
||||||
|
|
||||||
COPY --chown=matt:matt entry.sh ./
|
COPY --chown=ubuntu:ubuntu entry.sh ./
|
||||||
|
|
||||||
WORKDIR /home/matt/server/Linux
|
WORKDIR /home/ubuntu/server/Linux
|
||||||
|
|
||||||
RUN chmod +x TerrariaServer.bin.x86_64
|
RUN chmod +x TerrariaServer.bin.x86_64
|
||||||
COPY --chown=matt:matt password.default ./password.txt
|
COPY --chown=ubuntu:ubuntu password.default ./password.txt
|
||||||
COPY --chown=matt:matt config.txt password.tx[t] ./
|
COPY --chown=ubuntu:ubuntu config.txt password.tx[t] ./
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
world=/home/matt/worlds/legendary.wld
|
world=/home/ubuntu/worlds/legendary.wld
|
||||||
autocreate=3
|
autocreate=3
|
||||||
seed=getfixedboi
|
seed=getfixedboi
|
||||||
worldname=legendary
|
worldname=legendary
|
||||||
difficulty=2
|
difficulty=2
|
||||||
worldpath=/home/matt/worlds
|
worldpath=/home/ubuntu/worlds
|
||||||
|
@ -6,6 +6,7 @@ cleanup() {
|
|||||||
|
|
||||||
trap 'cleanup' TERM
|
trap 'cleanup' TERM
|
||||||
|
|
||||||
|
rm cmd
|
||||||
mkfifo cmd
|
mkfifo cmd
|
||||||
./TerrariaServer.bin.x86_64 -config config.txt -pass $(cat password.txt) < cmd &
|
./TerrariaServer.bin.x86_64 -config config.txt -pass $(cat password.txt) < cmd &
|
||||||
echo "help\n" > cmd # shell waits for FIFO to be opened for writing before starting program!
|
echo "help\n" > cmd # shell waits for FIFO to be opened for writing before starting program!
|
||||||
|
10
volumes.sh
Executable file
10
volumes.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir website/letsencrypt
|
||||||
|
mkdir website/gitea/config
|
||||||
|
mkdir website/gitea/data
|
||||||
|
mkdir monerod/.bitmonero
|
||||||
|
mkdir p2pool/cache
|
||||||
|
mkdir minecraft/world
|
||||||
|
mkdir minecraft_bedrock/worlds
|
||||||
|
mkdir terraria/worlds
|
Loading…
x
Reference in New Issue
Block a user