smodusermc commited on
Commit
69f226e
·
verified ·
1 Parent(s): 457bd99

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +112 -0
Dockerfile ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM oven/bun:latest
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y git
6
+
7
+ RUN git clone https://github.com/VillainsRule/CrackedShell.git .
8
+
9
+ # High-performance config without artificial limits
10
+ RUN echo 'export default { \
11
+ port: 7860, \
12
+ host: "0.0.0.0", \
13
+ whitelist: ["*"], \
14
+ corsOrigins: ["*"], \
15
+ blockAds: true, \
16
+ blockTracking: true, \
17
+ performanceMode: "aggressive" \
18
+ }' > config.ts
19
+
20
+ # Performance optimization without quality reduction
21
+ RUN mkdir -p scripts && echo '\
22
+ // Maximum performance without quality loss \
23
+ window.addEventListener("load", () => { \
24
+ // Remove FPS cap - let it run as fast as possible \
25
+ window.targetFPS = 144; \
26
+ window.unlockFPS = true; \
27
+ \
28
+ // Keep high quality but optimize rendering \
29
+ const canvas = document.querySelector("canvas"); \
30
+ if (canvas) { \
31
+ const ctx = canvas.getContext("webgl2", { \
32
+ antialias: true, \
33
+ powerPreference: "high-performance", \
34
+ desynchronized: true, \
35
+ preserveDrawingBuffer: false, \
36
+ failIfMajorPerformanceCaveat: false \
37
+ }); \
38
+ } \
39
+ \
40
+ // Maximum network update rate for smooth gameplay \
41
+ window.networkUpdateRate = 60; \
42
+ window.clientPrediction = true; \
43
+ window.interpolationDelay = 50; \
44
+ \
45
+ // Keep full quality settings \
46
+ window.textureQuality = 1.0; \
47
+ window.shadowQuality = "high"; \
48
+ window.particleCount = "normal"; \
49
+ window.renderDistance = "far"; \
50
+ \
51
+ // Enable GPU acceleration flags \
52
+ window.gpuAcceleration = true; \
53
+ window.useWebGL2 = true; \
54
+ \
55
+ // Optimize JavaScript execution \
56
+ window.optimizeAnimationLoop = true; \
57
+ window.useRequestIdleCallback = false; \
58
+ }); \
59
+ \
60
+ // Performance monitoring \
61
+ let lastTime = performance.now(); \
62
+ let frames = 0; \
63
+ \
64
+ function checkFPS() { \
65
+ frames++; \
66
+ const currentTime = performance.now(); \
67
+ if (currentTime >= lastTime + 1000) { \
68
+ console.log(`FPS: ${frames}`); \
69
+ frames = 0; \
70
+ lastTime = currentTime; \
71
+ } \
72
+ requestAnimationFrame(checkFPS); \
73
+ } \
74
+ checkFPS();' > scripts/performance.js
75
+
76
+ # Add Chrome flags optimization script
77
+ RUN echo '\
78
+ // Chromebook-specific optimizations without quality loss \
79
+ if (/CrOS/.test(navigator.userAgent)) { \
80
+ // Enable GPU rasterization \
81
+ chrome.gpuRasterization = true; \
82
+ \
83
+ // Use hardware acceleration \
84
+ document.body.style.transform = "translateZ(0)"; \
85
+ \
86
+ // Enable ANGLE graphics backend for better WebGL performance \
87
+ window.angleBackend = "opengl"; \
88
+ \
89
+ // Optimize canvas rendering \
90
+ CanvasRenderingContext2D.prototype.imageSmoothingEnabled = true; \
91
+ CanvasRenderingContext2D.prototype.imageSmoothingQuality = "high"; \
92
+ } \
93
+ \
94
+ // Optimize network for minimal latency \
95
+ if (window.RTCPeerConnection) { \
96
+ window.RTCPeerConnection.prototype.createDataChannel = new Proxy( \
97
+ window.RTCPeerConnection.prototype.createDataChannel, { \
98
+ apply(target, thisArg, args) { \
99
+ if (args[1]) { \
100
+ args[1].ordered = false; \
101
+ args[1].maxRetransmits = 0; \
102
+ } \
103
+ return target.apply(thisArg, args); \
104
+ } \
105
+ } \
106
+ ); \
107
+ }' > scripts/chromebook-optimize.js
108
+
109
+ RUN bun install
110
+
111
+ EXPOSE 7860
112
+ CMD ["bun", "."]