Fix container memory issues and server startup

- Added ulimits for memlock (required for Source engine)
- Increased memory limits to 8GB
- Added stdin_open and tty for proper console
- Added -disableluarefresh flag
- Use exec for proper signal handling
This commit is contained in:
Vish
2026-01-19 06:50:38 +00:00
parent 82ad91ea4e
commit c5763ef577
2 changed files with 15 additions and 7 deletions

View File

@@ -5,6 +5,8 @@ services:
dockerfile: docker/Dockerfile
container_name: gmod-prophunt
restart: unless-stopped
stdin_open: true
tty: true
environment:
- SRCDS_TOKEN=${SRCDS_TOKEN:-}
@@ -32,15 +34,21 @@ services:
networks:
- gmod-network
# Required for Source engine servers
ulimits:
memlock:
soft: -1
hard: -1
# Resource limits (optional, adjust as needed)
deploy:
resources:
limits:
cpus: '4'
memory: 4G
memory: 8G
reservations:
cpus: '1'
memory: 1G
memory: 2G
# Logging configuration
logging:

View File

@@ -179,9 +179,9 @@ cleanup() {
}
trap cleanup SIGTERM SIGINT
# Start the server
./srcds_run $ARGS &
SERVER_PID=$!
# Add -disableluarefresh to prevent lua refresh issues
# Add -norestart to prevent auto-restart loop issues in Docker
ARGS="$ARGS -disableluarefresh"
# Wait for the server process
wait $SERVER_PID
# Start the server (using exec to replace shell process)
exec ./srcds_run $ARGS