s2-dungeonsandexploits/Dockerfile

67 lines
2.1 KiB
Docker
Executable File

# FROM unityci/editor:ubuntu-2022.1.22f1-webgl-1.0.1 AS dungeonsandexploits_builder
# COPY "unity/game" "game"
# # RUN "$UNITY_PATH/Editor/Unity" \
# # -quit -batchmode -nographics \
# # -logFile "/dev/stdout" \
# # -createManualActivationFile \
# # -username "swzlcclbftnhqnzbgr@tmmcv.net" -password "D7H6L5dJ8nHXSRJ" -returnlicense
# # RUN cat "/Unity_v2022.1.22f1.alf"
# # https://license.unity3d.com/manual
# COPY "unity/Unity_v2022.x.ulf" "/root/.local/share/unity3d/Unity/Unity_lic.ulf"
# # RUN unity-editor \
# RUN "$UNITY_PATH/Editor/Unity" \
# -quit -batchmode -nographics \
# -logFile "/dev/stdout" \
# -projectPath "./game/" \
# -executeMethod "WebGLBuilder.Build"
FROM debian:latest AS dungeonsandexploits
# USERS
# RUN addgroup --system appgroup && adduser --ingroup appgroup --system appuser
WORKDIR /tmp
RUN apt-get update
# flask
RUN mkdir -p "/root/flask" && chmod -R "o=rX" "/root"
WORKDIR /root/flask
# # install dependencies
RUN apt-get install --no-install-recommends --upgrade -y python3 python3-pip
# init flask dependencies
COPY "flask/requirements.txt" "requirements.txt"
RUN chmod -R "o=rX" "/root"
# USER appuser
RUN python3 -m pip install --no-cache-dir --upgrade -r "requirements.txt"
# USER root
# clean some dependencies after build
RUN apt-get purge -y python3-pip
# init flask
COPY "flask/auth.py" "flask/game.py" "flask/server.py" "flask/website.py" ./
COPY "flask/models" "./models"
COPY "flask/static" "./static"
COPY "unity/game/Builds/WebGL" "./static/game"
# COPY --from="dungeonsandexploits_builder" "game/Builds/WebGL" "./static/game"
COPY "flask/templates" "./templates"
RUN chmod -R "o=rX" "/root"
# init https
# COPY "flask/cert.pem" "flask/key.pem" ./
# RUN chmod "444" "cert.pem" "key.pem"
# CLEANUP APT CACHE
RUN apt-get clean && rm -r /var/lib/apt/lists/*
# RUN
# USER appuser:appgroup
WORKDIR /root/flask
EXPOSE 8000
# ENTRYPOINT [ "/home/appuser/.local/bin/gunicorn", "server:app", \
ENTRYPOINT [ "/usr/local/bin/gunicorn", "server:app", \
"--bind", "0.0.0.0:8000", \
"--workers", "1", \
"--threads", "16", \
"--keyfile", "/secrets/privkey.pem", \
"--certfile", "/secrets/fullchain.pem" \
]