Spaces:
webzepetoku
/
Sleeping

File size: 3,366 Bytes
c12b2d9
a4cc3b1
 
c12b2d9
8f03243
c12b2d9
a4cc3b1
 
c12b2d9
a4cc3b1
 
26ea660
c12b2d9
a4cc3b1
 
c12b2d9
a4cc3b1
 
 
c12b2d9
a4cc3b1
 
c12b2d9
a4cc3b1
 
 
c12b2d9
a4cc3b1
 
c12b2d9
a4cc3b1
 
26ea660
c12b2d9
a4cc3b1
 
c12b2d9
a4cc3b1
 
 
c12b2d9
a4cc3b1
 
 
8f03243
c12b2d9
68a9cc5
b7ad9c7
c893e9e
c12b2d9
fb53200
 
 
c12b2d9
 
6a7ed5e
c12b2d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4d2eee9
6a7ed5e
68a9cc5
26ea660
e394ae1
c12b2d9
d1115bb
75c00cd
 
c12b2d9
78e0abf
68a9cc5
75c00cd
 
26ea660
 
c12b2d9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# ==========================================#
# STAGE 0: Base Linux (Sudah include Linux IL2CPP)
# ==========================================
FROM unityci/editor:ubuntu-2022.3.34f1-linux-il2cpp-3 AS base-engine

# ==========================================#
# STAGE 1: Injeksi Android Build Support
# ==========================================
FROM unityci/editor:ubuntu-2022.3.34f1-android-3 AS source-android
FROM base-engine AS step-android
COPY --from=source-android /opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer /opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer

# ==========================================#
# STAGE 2: Injeksi iOS Build Support
# ==========================================
FROM unityci/editor:ubuntu-2022.3.34f1-ios-3 AS source-ios
FROM step-android AS step-ios
COPY --from=source-ios /opt/unity/Editor/Data/PlaybackEngines/iOSSupport /opt/unity/Editor/Data/PlaybackEngines/iOSSupport

# ==========================================#
# STAGE 3: Injeksi Mac Build Support (Mono)
# ==========================================
FROM unityci/editor:ubuntu-2022.3.34f1-mac-mono-3 AS source-mac
FROM step-ios AS step-mac
COPY --from=source-mac /opt/unity/Editor/Data/PlaybackEngines/MacStandaloneSupport /opt/unity/Editor/Data/PlaybackEngines/MacStandaloneSupport

# ==========================================#
# STAGE 4: Injeksi WebGL Build Support
# ==========================================
FROM unityci/editor:ubuntu-2022.3.34f1-webgl-3 AS source-webgl
FROM step-mac AS step-webgl
COPY --from=source-webgl /opt/unity/Editor/Data/PlaybackEngines/WebGLSupport /opt/unity/Editor/Data/PlaybackEngines/WebGLSupport

# ==========================================#
# STAGE 5: Injeksi Windows Build Support (Mono)
# ==========================================
FROM unityci/editor:ubuntu-2022.3.34f1-windows-mono-3 AS source-win
FROM step-webgl AS step-win
COPY --from=source-win /opt/unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport /opt/unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport

# ==========================================#
# STAGE 6: Final Setup (Python, Tools & App)
# ==========================================
FROM step-win AS final-build

USER root
ENV UNITY_PATH=/opt/unity/Editor/Unity
ENV DEBIAN_FRONTEND=noninteractive

# Setup Timezone
RUN apt-get update && apt-get install -y tzdata
ENV TZ=Asia/Jakarta
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Instalasi Python & Dependensi (Menyesuaikan dengan Ubuntu Default)
RUN apt-get update && apt-get install -y \
    python3 \
    python3-pip \
    python3-dev \
    curl \
    libnss3 \
    ca-certificates \
    xvfb \
    && python3 -m pip install --no-cache-dir --upgrade pip \
    && python3 -m pip install --no-cache-dir \
    fastapi \
    uvicorn \
    boto3 \
    requests \
    httpx \
    python-multipart \
    aiofiles \
    pydantic \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

ENV HOME=/tmp
WORKDIR /app

# Setup Folder Unity Writable (Penting agar lisensi tidak mental)
RUN mkdir -p /tmp/.local/share/unity3d/Unity /tmp/.config/unity3d /tmp/.cache/unity3d && \
    chmod -R 777 /tmp

# Salin Project
COPY --chown=1000:1000 . /app
RUN chmod -R 777 /app

USER 1000
EXPOSE 7860

# CMD menggunakan python3 default sistem
CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]