Initial commit
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 2m5s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 2m5s
This commit is contained in:
23
.gitea/workflows/build-push.yml
Normal file
23
.gitea/workflows/build-push.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Log in to private registry
|
||||||
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login registry.ciomek.pl/bta-server:latest -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: docker build -t registry.ciomek.pl/bta-server:latest .
|
||||||
|
|
||||||
|
- name: Push Docker image
|
||||||
|
run: docker push registry.ciomek.pl/bta-server:latest
|
||||||
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
FROM debian:bullseye
|
||||||
|
|
||||||
|
WORKDIR /server/
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN apt update && apt install -y wget openjdk-17-jre
|
||||||
|
|
||||||
|
RUN wget -O server.jar https://github.com/Better-than-Adventure/bta-download-repo/releases/download/v7.3_04/bta.v7.3_04.server.jar
|
||||||
|
|
||||||
|
VOLUME ["/server/world"]
|
||||||
|
|
||||||
|
ENV JAVA_MIN_MEM=1G
|
||||||
|
ENV JAVA_MAX_MEM=1G
|
||||||
|
|
||||||
|
RUN chmod +x /server/entrypoint.sh
|
||||||
|
|
||||||
|
EXPOSE 25565
|
||||||
|
|
||||||
|
ENTRYPOINT ["/server/entrypoint.sh"]
|
||||||
24
docker-compose.yml
Normal file
24
docker-compose.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
bta-server:
|
||||||
|
image: 192.168.65.110:5000/bta-server
|
||||||
|
container_name: bta-server
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "25565:25565"
|
||||||
|
entrypoint: ["/server/entrypoint.sh"]
|
||||||
|
environment:
|
||||||
|
- JAVA_MAX_MEM=2G
|
||||||
|
- JAVA_MIN_MEM=1G
|
||||||
|
volumes:
|
||||||
|
- bta-server-world:/server/world
|
||||||
|
networks:
|
||||||
|
- bta-network
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
bta-server-world:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
bta-network:
|
||||||
|
driver: bridge
|
||||||
3
entrypoint.sh
Normal file
3
entrypoint.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
exec java -Xms${JAVA_MIN_MEM} -Xmx${JAVA_MAX_MEM} -jar /server/server.jar
|
||||||
Reference in New Issue
Block a user