forked from arkutils/Purlovia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (49 loc) · 1.62 KB
/
Dockerfile
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
FROM python:3.7-slim-buster
ARG COMMIT=""
ARG BRANCH=dev
ENV COMMIT_SHA $COMMIT
ENV COMMIT_BRANCH $BRANCH
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# Maybe???
ENV PYTHONDONTWRITEBYTECODE 1
# Install:
# git for output repo management
# ssh for git to use contacting GitHub
# lib32gcc1 as required by SteamCMD
#
# Clean up caches
# Create /app path and a safe user
RUN set -ex \
&& apt-get update \
&& apt-get install --no-install-recommends -y git openssh-client lib32gcc1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* \
&& mkdir -p /app \
&& groupadd -r purlovia \
&& useradd --no-log-init -r -g purlovia -d /app purlovia
# Copy the app over
WORKDIR /app
COPY . .
# Install:
# gcc for library compilation
# requirements from Pipfile.lock using pipenv, system-wide
#
# Compile the version-grabbing log hook
# Uninstall gcc and clean up caches
RUN set -ex \
&& apt-get update \
&& apt-get install --no-install-recommends -y gcc libc6-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* \
&& pip3 install pipenv \
&& pipenv install --deploy --system \
&& pip3 uninstall -y pipenv \
&& gcc /app/utils/shootergameserver_fwrite_hook.c -o /app/utils/shootergameserver_fwrite_hook.so -fPIC -shared -ldl \
&& apt-get purge -y --auto-remove gcc libc6-dev \
&& rm -r /root/.cache \
&& rm Pipfile Pipfile.lock
VOLUME /app/logs /app/livedata /app/output /app/config
USER purlovia:purlovia
CMD [ "python3", "-m", "automate"]