webzepetoku commited on
Commit
4d2eee9
·
verified ·
1 Parent(s): d1115bb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -20
Dockerfile CHANGED
@@ -1,44 +1,37 @@
1
- # Gunakan Image Unity asli Abang
2
  FROM unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3
3
 
4
  USER root
5
 
6
- # 1. Update & Install Python + Library dalam SATU LAYER biar irit space
7
  RUN apt-get update && apt-get install -y \
8
  python3 \
9
  python3-pip \
10
  libnss3 \
11
  ca-certificates \
12
- && rm -rf /var/lib/apt/lists/*
13
 
14
- # 2. Install Python Deps & Register Unity Hub dalam satu langkah
15
- RUN pip3 install --no-cache-dir fastapi uvicorn python-multipart aiofiles boto3 pydantic requests playwright && \
16
- unity-hub editors --register --version 2022.3.10f1 --path /opt/unity/Editor/Unity
17
 
18
- # 3. PILIH MODUL YANG PENTING SAJA (Jangan borong semua biar gak Disk Full)
19
- # Saya saranin Android & Windows dulu. Kalau butuh yang lain, tambahin satu-satu.
20
- RUN unity-hub install-modules --version 2022.3.10f1 --module android,windows-mono,webgl --childModules
 
21
 
22
- # 4. Playwright (Hanya chromium)
23
- RUN playwright install chromium && playwright install-deps chromium
24
-
25
- # 5. Environment
26
  ENV HOME=/tmp \
27
- XDG_CONFIG_HOME=/tmp/.config \
28
- XDG_CACHE_HOME=/tmp/.cache \
29
- XDG_DATA_HOME=/tmp/.local/share \
30
  UNITY_PATH=/opt/unity/Editor/Unity
31
 
32
  WORKDIR /app
33
 
34
- # 6. Buat folder tmp dan COPY project dalam satu urutan
35
  RUN mkdir -p /tmp/.local/share/unity3d/Unity /tmp/.config/unity3d /tmp/.cache/unity3d && \
36
  chmod -R 777 /tmp
37
 
38
- # COPY langsung kasih izin lewat --chown, gak usah pake RUN chmod lagi di bawahnya
39
  COPY --chown=1000:1000 . /app
40
-
41
- # Pastikan folder app punya izin tulis sebelum pindah user
42
  RUN chmod -R 777 /app
43
 
44
  USER 1000
 
1
+ # Gunakan Base Image asli Abang
2
  FROM unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3
3
 
4
  USER root
5
 
6
+ # 1. Install Python & Pip saja
7
  RUN apt-get update && apt-get install -y \
8
  python3 \
9
  python3-pip \
10
  libnss3 \
11
  ca-certificates \
12
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
13
 
14
+ # 2. Library Python Wajib (Tanpa Playwright)
15
+ # Hanya: Server (fastapi, uvicorn), Download (requests), Upload (boto3)
16
+ RUN pip3 install --no-cache-dir fastapi uvicorn boto3 requests
17
 
18
+ # 3. Register & Install Modul Unity
19
+ # Register dulu biar Unity Hub tahu lokasinya, lalu install modul yang benar-benar dipakai
20
+ RUN unity-hub editors --register --version 2022.3.10f1 --path /opt/unity/Editor/Unity && \
21
+ unity-hub install-modules --version 2022.3.10f1 --module android,windows-mono,webgl --childModules
22
 
23
+ # 4. Environment Variables
 
 
 
24
  ENV HOME=/tmp \
 
 
 
25
  UNITY_PATH=/opt/unity/Editor/Unity
26
 
27
  WORKDIR /app
28
 
29
+ # 5. Setup Folder Temp & Izin Akses
30
  RUN mkdir -p /tmp/.local/share/unity3d/Unity /tmp/.config/unity3d /tmp/.cache/unity3d && \
31
  chmod -R 777 /tmp
32
 
33
+ # 6. Copy Project
34
  COPY --chown=1000:1000 . /app
 
 
35
  RUN chmod -R 777 /app
36
 
37
  USER 1000