add run.sh/bat, simplify/update docker config, ...

- add run.sh and run.bat
- change docker config
  - by default include source in docker image for simple debug (can be disabled via uncoment section in Dockerfile)
  - add docker-compose.yml
- change default time to start first battle event after server start (login first player) to 3 minutes
This commit is contained in:
Robert Paciorek 2024-03-19 20:45:56 +00:00
parent 445d032a74
commit fa0870784a
6 changed files with 38 additions and 22 deletions

View File

@ -1,8 +1,5 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
@ -14,12 +11,8 @@
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

21
docker-compose.yml Normal file
View File

@ -0,0 +1,21 @@
version: '3.8'
services:
sodoffmmo:
build:
context: .
dockerfile: src/Dockerfile
ports:
- "9933:9933"
networks:
- sodoff_network
networks:
sodoff_network:
name: sodoff_network
# bellow network configuration should be put in at least one file
# - but it may be in many or all
# - without it it will work like `external: true`
driver: bridge
ipam:
config:
- subnet: "172.16.99.0/24"

3
run.bat Executable file
View File

@ -0,0 +1,3 @@
dotnet run --project src/sodoffmmo.csproj
pause

1
run.sh Executable file
View File

@ -0,0 +1 @@
dotnet run --project src/sodoffmmo.csproj

View File

@ -1,20 +1,18 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app
# Use the official .NET SDK image for building the application
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/sodoffmmo.csproj", "src/"]
RUN dotnet restore "src/sodoffmmo.csproj"
# Copy the source code
COPY . .
WORKDIR "/src/src"
RUN dotnet build "sodoffmmo.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "sodoffmmo.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Restore dependencies and build the application
RUN dotnet build -c Release -o /app
FROM base AS final
# Create clean run environment (without source and sdk)
# FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
# WORKDIR /app
# COPY --from=build /app .
# Run the application
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "sodoffmmo.dll"]
ENTRYPOINT ["./sodoffmmo"]

View File

@ -10,7 +10,7 @@
"EnableChat": true,
"// FirstEventTimer": "time to start of first world event (battle ship event) after start MMO server",
"FirstEventTimer": 10,
"FirstEventTimer": 3,
"// EventTimer": "time between start of world events (battle ship events)",
"EventTimer": 30,