game / Dockerfile
smodusermc's picture
Create Dockerfile
69f226e verified
Raw History Blame Contribute Delete
3.36 kB
FROM oven/bun:latest
WORKDIR /app
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/VillainsRule/CrackedShell.git .
# High-performance config without artificial limits
RUN echo 'export default { \
port: 7860, \
host: "0.0.0.0", \
whitelist: ["*"], \
corsOrigins: ["*"], \
blockAds: true, \
blockTracking: true, \
performanceMode: "aggressive" \
}' > config.ts
# Performance optimization without quality reduction
RUN mkdir -p scripts && echo '\
// Maximum performance without quality loss \
window.addEventListener("load", () => { \
// Remove FPS cap - let it run as fast as possible \
window.targetFPS = 144; \
window.unlockFPS = true; \
\
// Keep high quality but optimize rendering \
const canvas = document.querySelector("canvas"); \
if (canvas) { \
const ctx = canvas.getContext("webgl2", { \
antialias: true, \
powerPreference: "high-performance", \
desynchronized: true, \
preserveDrawingBuffer: false, \
failIfMajorPerformanceCaveat: false \
}); \
} \
\
// Maximum network update rate for smooth gameplay \
window.networkUpdateRate = 60; \
window.clientPrediction = true; \
window.interpolationDelay = 50; \
\
// Keep full quality settings \
window.textureQuality = 1.0; \
window.shadowQuality = "high"; \
window.particleCount = "normal"; \
window.renderDistance = "far"; \
\
// Enable GPU acceleration flags \
window.gpuAcceleration = true; \
window.useWebGL2 = true; \
\
// Optimize JavaScript execution \
window.optimizeAnimationLoop = true; \
window.useRequestIdleCallback = false; \
}); \
\
// Performance monitoring \
let lastTime = performance.now(); \
let frames = 0; \
\
function checkFPS() { \
frames++; \
const currentTime = performance.now(); \
if (currentTime >= lastTime + 1000) { \
console.log(`FPS: ${frames}`); \
frames = 0; \
lastTime = currentTime; \
} \
requestAnimationFrame(checkFPS); \
} \
checkFPS();' > scripts/performance.js
# Add Chrome flags optimization script
RUN echo '\
// Chromebook-specific optimizations without quality loss \
if (/CrOS/.test(navigator.userAgent)) { \
// Enable GPU rasterization \
chrome.gpuRasterization = true; \
\
// Use hardware acceleration \
document.body.style.transform = "translateZ(0)"; \
\
// Enable ANGLE graphics backend for better WebGL performance \
window.angleBackend = "opengl"; \
\
// Optimize canvas rendering \
CanvasRenderingContext2D.prototype.imageSmoothingEnabled = true; \
CanvasRenderingContext2D.prototype.imageSmoothingQuality = "high"; \
} \
\
// Optimize network for minimal latency \
if (window.RTCPeerConnection) { \
window.RTCPeerConnection.prototype.createDataChannel = new Proxy( \
window.RTCPeerConnection.prototype.createDataChannel, { \
apply(target, thisArg, args) { \
if (args[1]) { \
args[1].ordered = false; \
args[1].maxRetransmits = 0; \
} \
return target.apply(thisArg, args); \
} \
} \
); \
}' > scripts/chromebook-optimize.js
RUN bun install
EXPOSE 7860
CMD ["bun", "."]